code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0040 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0039" href="CMP0039.html" />
    <link rel="prev" title="CMP0041" href="CMP0041.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0040

CMP0040¶

The target in the TARGET signature of add_custom_command()
must exist and must be defined in the current directory.

CMake 2.8.12 and lower silently ignored a custom command created with
the TARGET signature of add_custom_command()
if the target is unknown or was defined outside the current directory.

The OLD behavior for this policy is to ignore custom commands
for unknown targets.  The NEW behavior for this policy is to report
an error if the target referenced in add_custom_command() is
unknown or was defined outside the current directory.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0041

Next topic

CMP0039

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0040

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0041 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0040" href="CMP0040.html" />
    <link rel="prev" title="CMP0042" href="CMP0042.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0041

CMP0041¶

Error on relative include with generator expression.

Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
INTERFACE_INCLUDE_DIRECTORIES of a target if it contained a generator
expression at any position.

The path entries in that target property should not be relative. High-level
API should ensure that by adding either a source directory or a install
directory prefix, as appropriate.

As an additional diagnostic, the INTERFACE_INCLUDE_DIRECTORIES generated
on an IMPORTED target for the install location should not contain
paths in the source directory or the build directory.

The OLD behavior for this policy is to ignore relative path entries if they
contain a generator expression. The NEW behavior for this policy is to report
an error if a generator expression appears in another location and the path is
relative.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0042

Next topic

CMP0040

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0041

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0042 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0041" href="CMP0041.html" />
    <link rel="prev" title="CMP0043" href="CMP0043.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0042

CMP0042¶

MACOSX_RPATH is enabled by default.

CMake 2.8.12 and newer has support for using @rpath in a target's install
name.  This was enabled by setting the target property
MACOSX_RPATH.  The @rpath in an install name is a more
flexible and powerful mechanism than @executable_path or @loader_path
for locating shared libraries.

CMake 3.0 and later prefer this property to be ON by default.  Projects
wanting @rpath in a target's install name may remove any setting of
the INSTALL_NAME_DIR and CMAKE_INSTALL_NAME_DIR
variables.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0043

Next topic

CMP0041

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0042

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0043 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0042" href="CMP0042.html" />
    <link rel="prev" title="CMP0044" href="CMP0044.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0043

CMP0043¶

Ignore COMPILE_DEFINITIONS_<Config> properties

CMake 2.8.12 and lower allowed setting the
COMPILE_DEFINITIONS_<CONFIG> target property and
COMPILE_DEFINITIONS_<CONFIG> directory property to apply
configuration-specific compile definitions.

Since CMake 2.8.10, the COMPILE_DEFINITIONS property has supported
generator expressions for setting
configuration-dependent content.  The continued existence of the suffixed
variables is redundant, and causes a maintenance burden.  Population of the
COMPILE_DEFINITIONS_DEBUG property
may be replaced with a population of COMPILE_DEFINITIONS directly
or via target_compile_definitions():

# Old Interfaces:
set_property(TARGET tgt APPEND PROPERTY
  COMPILE_DEFINITIONS_DEBUG DEBUG_MODE
)
set_property(DIRECTORY APPEND PROPERTY
  COMPILE_DEFINITIONS_DEBUG DIR_DEBUG_MODE
)

# New Interfaces:
set_property(TARGET tgt APPEND PROPERTY
  COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG_MODE>
)
target_compile_definitions(tgt PRIVATE $<$<CONFIG:Debug>:DEBUG_MODE>)
set_property(DIRECTORY APPEND PROPERTY
  COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DIR_DEBUG_MODE>
)

The OLD behavior for this policy is to consume the content of the suffixed
COMPILE_DEFINITIONS_<CONFIG> target property when generating the
compilation command. The NEW behavior for this policy is to ignore the content
of the COMPILE_DEFINITIONS_<CONFIG> target property .

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0044

Next topic

CMP0042

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0043

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0044 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0043" href="CMP0043.html" />
    <link rel="prev" title="CMP0045" href="CMP0045.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0044

CMP0044¶

Case sensitive <LANG>_COMPILER_ID generator expressions

CMake 2.8.12 introduced the <LANG>_COMPILER_ID
generator expressions to allow
comparison of the CMAKE_<LANG>_COMPILER_ID with a test value.  The
possible valid values are lowercase, but the comparison with the test value
was performed case-insensitively.

The OLD behavior for this policy is to perform a case-insensitive comparison
with the value in the <LANG>_COMPILER_ID expression. The NEW behavior
for this policy is to perform a case-sensitive comparison with the value in
the <LANG>_COMPILER_ID expression.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0045

Next topic

CMP0043

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0044

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0045 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0044" href="CMP0044.html" />
    <link rel="prev" title="CMP0046" href="CMP0046.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0045

CMP0045¶

Error on non-existent target in get_target_property.

In CMake 2.8.12 and lower, the get_target_property() command accepted
a non-existent target argument without issuing any error or warning.  The
result variable is set to a -NOTFOUND value.

The OLD behavior for this policy is to issue no warning and set the result
variable to a -NOTFOUND value.  The NEW behavior
for this policy is to issue a FATAL_ERROR if the command is called with a
non-existent target.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0046

Next topic

CMP0044

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0045

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0046 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0045" href="CMP0045.html" />
    <link rel="prev" title="CMP0047" href="CMP0047.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0046

CMP0046¶

Error on non-existent dependency in add_dependencies.

CMake 2.8.12 and lower silently ignored non-existent dependencies
listed in the add_dependencies() command.

The OLD behavior for this policy is to silently ignore non-existent
dependencies. The NEW behavior for this policy is to report an error
if non-existent dependencies are listed in the add_dependencies()
command.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0047

Next topic

CMP0045

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0046

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0047 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0046" href="CMP0046.html" />
    <link rel="prev" title="CMP0048" href="CMP0048.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0047

CMP0047¶

Use QCC compiler id for the qcc drivers on QNX.

CMake 3.0 and above recognize that the QNX qcc compiler driver is
different from the GNU compiler.
CMake now prefers to present this to projects by setting the
CMAKE_<LANG>_COMPILER_ID variable to QCC instead
of GNU.  However, existing projects may assume the compiler id for
QNX qcc is just GNU as it was in CMake versions prior to 3.0.
Therefore this policy determines for QNX qcc which compiler id to
report in the CMAKE_<LANG>_COMPILER_ID variable after
language <LANG> is enabled by the project() or
enable_language() command.  The policy must be set prior
to the invocation of either command.

The OLD behavior for this policy is to use the GNU compiler id
for the qcc and QCC compiler drivers. The NEW behavior for this policy
is to use the QCC compiler id for those drivers.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0047
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0048

Next topic

CMP0046

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0047

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0048 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0047" href="CMP0047.html" />
    <link rel="prev" title="CMP0049" href="CMP0049.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0048

CMP0048¶

The project() command manages VERSION variables.

CMake version 3.0 introduced the VERSION option of the project()
command to specify a project version as well as the name.  In order to keep
PROJECT_VERSION and related variables consistent with variable
PROJECT_NAME it is necessary to set the VERSION variables
to the empty string when no VERSION is given to project().
However, this can change behavior for existing projects that set VERSION
variables themselves since project() may now clear them.
This policy controls the behavior for compatibility with such projects.

The OLD behavior for this policy is to leave VERSION variables untouched.
The NEW behavior for this policy is to set VERSION as documented by the
project() command.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0049

Next topic

CMP0047

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0048

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0049 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0048" href="CMP0048.html" />
    <link rel="prev" title="CMP0050" href="CMP0050.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0049

CMP0049¶

Do not expand variables in target source entries.

CMake 2.8.12 and lower performed an extra layer of variable expansion
when evaluating source file names:

set(a_source foo.c)
add_executable(foo \${a_source})

This was undocumented behavior.

The OLD behavior for this policy is to expand such variables when processing
the target sources.  The NEW behavior for this policy is to issue an error
if such variables need to be expanded.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0050

Next topic

CMP0048

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0049

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0050 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0049" href="CMP0049.html" />
    <link rel="prev" title="CMP0051" href="CMP0051.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0050

CMP0050¶

Disallow add_custom_command SOURCE signatures.

CMake 2.8.12 and lower allowed a signature for add_custom_command()
which specified an input to a command.  This was undocumented behavior.
Modern use of CMake associates custom commands with their output, rather
than their input.

The OLD behavior for this policy is to allow the use of
add_custom_command() SOURCE signatures.  The NEW behavior for this
policy is to issue an error if such a signature is used.

This policy was introduced in CMake version 3.0.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0051

Next topic

CMP0049

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0050

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0051 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0050" href="CMP0050.html" />
    <link rel="prev" title="CMP0052" href="CMP0052.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0051

CMP0051¶

New in version 3.1.

List TARGET_OBJECTS in SOURCES target property.

CMake 3.0 and lower did not include the TARGET_OBJECTS
generator expression when
returning the SOURCES target property.

Configure-time CMake code is not able to handle generator expressions.  If
using the SOURCES target property at configure time, it may be
necessary to first remove generator expressions using the
string(GENEX_STRIP) command.  Generate-time CMake code such as
file(GENERATE) can handle the content without stripping.

The OLD behavior for this policy is to omit TARGET_OBJECTS
expressions from the SOURCES target property.  The NEW
behavior for this policy is to include TARGET_OBJECTS expressions
in the output.

This policy was introduced in CMake version 3.1.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0052

Next topic

CMP0050

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0051

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0052 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0051" href="CMP0051.html" />
    <link rel="prev" title="CMP0053" href="CMP0053.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0052

CMP0052¶

New in version 3.1.

Reject source and build dirs in installed
INTERFACE_INCLUDE_DIRECTORIES.

CMake 3.0 and lower allowed subdirectories of the source directory or build
directory to be in the INTERFACE_INCLUDE_DIRECTORIES of
installed and exported targets, if the directory was also a subdirectory of
the installation prefix.  This makes the installation depend on the
existence of the source dir or binary dir, and the installation will be
broken if either are removed after installation.

See Include Directories and Usage Requirements for more on
specifying include directories for targets.

The OLD behavior for this policy is to export the content of the
INTERFACE_INCLUDE_DIRECTORIES with the source or binary
directory.  The NEW behavior for this
policy is to issue an error if such a directory is used.

This policy was introduced in CMake version 3.1.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0053

Next topic

CMP0051

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0052

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0053 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0052" href="CMP0052.html" />
    <link rel="prev" title="CMP0054" href="CMP0054.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0053

CMP0053¶

New in version 3.1.

Simplify variable reference and escape sequence evaluation.

CMake 3.1 introduced a much faster implementation of evaluation of the
Variable References and Escape Sequences documented in the
cmake-language(7) manual.  While the behavior is identical
to the legacy implementation in most cases, some corner cases were
cleaned up to simplify the behavior.  Specifically:

Expansion of @VAR@ reference syntax defined by the
configure_file() and string(CONFIGURE)
commands is no longer performed in other contexts.

Literal ${VAR} reference syntax may contain only
alphanumeric characters (A-Z, a-z, 0-9) and
the characters _, ., /, -, and +.
Note that $ is technically allowed in the NEW behavior, but is
invalid for OLD behavior.  This is due to an oversight during the
implementation of CMP0053 and its use as a literal variable
reference is discouraged for this reason.
Variables with other characters in their name may still
be referenced indirectly, e.g.

set(varname "otherwise & disallowed $ characters")
message("${${varname}}")

The setting of policy CMP0010 is not considered,
so improper variable reference syntax is always an error.

More characters are allowed to be escaped in variable names.
Previously, only ()#" \@^ were valid characters to
escape. Now any non-alphanumeric, non-semicolon, non-NUL
character may be escaped following the escape_identity
production in the Escape Sequences section of the
cmake-language(7) manual.

The OLD behavior for this policy is to honor the legacy behavior for
variable references and escape sequences.  The NEW behavior is to
use the simpler variable expansion and escape sequence evaluation rules.

This policy was introduced in CMake version 3.1.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0054

Next topic

CMP0052

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0053

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0054 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0053" href="CMP0053.html" />
    <link rel="prev" title="CMP0055" href="CMP0055.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0054

CMP0054¶

New in version 3.1.

Only interpret if() arguments as variables or keywords when unquoted.

CMake 3.1 and above no longer implicitly dereference variables or
interpret keywords in an if() command argument when
it is a Quoted Argument or a Bracket Argument.

The OLD behavior for this policy is to dereference variables and
interpret keywords even if they are quoted or bracketed.
The NEW behavior is to not dereference variables or interpret keywords
that have been quoted or bracketed.

Given the following partial example:

set(A E)
set(E "")

if("${A}" STREQUAL "")
  message("Result is TRUE before CMake 3.1 or when CMP0054 is OLD")
else()
  message("Result is FALSE in CMake 3.1 and above if CMP0054 is NEW")
endif()

After explicit expansion of variables this gives:

if("E" STREQUAL "")

With the policy set to OLD implicit expansion reduces this semantically to:

if("" STREQUAL "")

With the policy set to NEW the quoted arguments will not be
further dereferenced:

if("E" STREQUAL "")

This policy was introduced in CMake version 3.1.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0055

Next topic

CMP0053

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0054

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0055 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0054" href="CMP0054.html" />
    <link rel="prev" title="CMP0056" href="CMP0056.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0055

CMP0055¶

New in version 3.2.

Strict checking for the break() command.

CMake 3.1 and lower allowed calls to the break() command
outside of a loop context and also ignored any given arguments.
This was undefined behavior.

The OLD behavior for this policy is to allow break() to be placed
outside of loop contexts and ignores any arguments.  The NEW behavior for this
policy is to issue an error if a misplaced break or any arguments are found.

This policy was introduced in CMake version 3.2.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0056

Next topic

CMP0054

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0055

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0056 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0055" href="CMP0055.html" />
    <link rel="prev" title="CMP0057" href="CMP0057.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0056

CMP0056¶

New in version 3.2.

Honor link flags in try_compile() source-file signature.

The try_compile() command source-file signature generates a
CMakeLists.txt file to build the source file into an executable.
In order to compile the source the same way as it might be compiled
by the calling project, the generated project sets the value of the
CMAKE_<LANG>_FLAGS variable to that in the calling project.
The value of the CMAKE_EXE_LINKER_FLAGS variable may be
needed in some cases too, but CMake 3.1 and lower did not set it in
the generated project.  CMake 3.2 and above prefer to set it so that
linker flags are honored as well as compiler flags.  This policy
provides compatibility with the pre-3.2 behavior.

The OLD behavior for this policy is to not set the value of the
CMAKE_EXE_LINKER_FLAGS variable in the generated test
project.  The NEW behavior for this policy is to set the value of
the CMAKE_EXE_LINKER_FLAGS variable in the test project
to the same as it is in the calling project.

If the project code does not set the policy explicitly, users may
set it on the command line by defining the
CMAKE_POLICY_DEFAULT_CMP0056
variable in the cache.

This policy was introduced in CMake version 3.2.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0056
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0057

Next topic

CMP0055

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0056

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0057 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0056" href="CMP0056.html" />
    <link rel="prev" title="CMP0058" href="CMP0058.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0057

CMP0057¶

New in version 3.3.

Support new if() IN_LIST operator.

CMake 3.3 adds support for the new IN_LIST operator.

The OLD behavior for this policy is to ignore the IN_LIST operator.
The NEW behavior is to interpret the IN_LIST operator.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0058

Next topic

CMP0056

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0057

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0058 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0057" href="CMP0057.html" />
    <link rel="prev" title="CMP0059" href="CMP0059.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0058

CMP0058¶

New in version 3.3.

Ninja requires custom command byproducts to be explicit.

When an intermediate file generated during the build is consumed
by an expensive operation or a large tree of dependents, one may
reduce the work needed for an incremental rebuild by updating the
file timestamp only when its content changes.  With this approach
the generation rule must have a separate output file that is always
updated with a new timestamp that is newer than any dependencies of
the rule so that the build tool re-runs the rule only when the input
changes.  We refer to the separate output file as a rule's witness
and the generated file as a rule's byproduct.

Byproducts may not be listed as outputs because their timestamps are
allowed to be older than the inputs.  No build tools (like make)
that existed when CMake was designed have a way to express byproducts.
Therefore CMake versions prior to 3.2 had no way to specify them.
Projects typically left byproducts undeclared in the rules that
generate them.  For example:

add_custom_command(
  OUTPUT witness.txt
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
          ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
          byproduct.txt # timestamp may not change
  COMMAND ${CMAKE_COMMAND} -E touch witness.txt
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
  )
add_custom_target(Provider DEPENDS witness.txt)
add_custom_command(
  OUTPUT generated.c
  COMMAND expensive-task -i byproduct.txt -o generated.c
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/byproduct.txt
  )
add_library(Consumer generated.c)
add_dependencies(Consumer Provider)

This works well for all generators except Ninja.
The Ninja build tool sees a rule listing byproduct.txt
as a dependency and no rule listing it as an output.  Ninja then
complains that there is no way to satisfy the dependency and
stops building even though there are order-only dependencies
that ensure byproduct.txt will exist before its consumers
need it.  See discussion of this problem in Ninja Issue 760
for further details on why Ninja works this way.

Instead of leaving byproducts undeclared in the rules that generate
them, Ninja expects byproducts to be listed along with other outputs.
Such rules may be marked with a restat option that tells Ninja
to check the timestamps of outputs after the rules run.  This
prevents byproducts whose timestamps do not change from causing
their dependents to re-build unnecessarily.

Since the above approach does not tell CMake what custom command
generates byproduct.txt, the Ninja generator does not have
enough information to add the byproduct as an output of any rule.
CMake 2.8.12 and above work around this problem and allow projects
using the above approach to build by generating phony build
rules to tell Ninja to tolerate such missing files.  However, this
workaround prevents Ninja from diagnosing a dependency that is
really missing.  It also works poorly in in-source builds where
every custom command dependency, even on source files, needs to
be treated this way because CMake does not have enough information
to know which files are generated as byproducts of custom commands.

Introducing Byproducts¶

CMake 3.2 introduced the BYPRODUCTS option to the
add_custom_command() and add_custom_target()
commands.  This option allows byproducts to be specified explicitly:

add_custom_command(
  OUTPUT witness.txt
  BYPRODUCTS byproduct.txt # explicit byproduct specification
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
          ${CMAKE_CURRENT_SOURCE_DIR}/input.txt
          byproduct.txt # timestamp may not change
...

The BYPRODUCTS option is used by the Ninja generator
to list byproducts among the outputs of the custom commands that
generate them, and is ignored by other generators.

CMake 3.3 and above prefer to require projects to specify custom
command byproducts explicitly so that it can avoid using the
phony rule workaround altogether.  Policy CMP0058 was
introduced to provide compatibility with existing projects that
still need the workaround.

This policy has no effect on generators other than Ninja.
The OLD behavior for this policy is to generate Ninja phony
rules for unknown dependencies in the build tree.  The NEW
behavior for this policy is to not generate these and instead
require projects to specify custom command BYPRODUCTS explicitly.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns when it sees unknown dependencies in out-of-source build trees, and uses OLD behavior.

The policy setting must be in scope at the end of the top-level
CMakeLists.txt file of the project and has global effect.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Table of Contents

CMP0058

Introducing Byproducts

Previous topic

CMP0059

Next topic

CMP0057

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0058

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0059 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0058" href="CMP0058.html" />
    <link rel="prev" title="CMP0060" href="CMP0060.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0059

CMP0059¶

New in version 3.3.

Do not treat DEFINITIONS as a built-in directory property.

CMake 3.3 and above no longer make a list of definitions available through
the DEFINITIONS directory property.  The
COMPILE_DEFINITIONS directory property may be used instead.

The OLD behavior for this policy is to provide the list of flags given
so far to the add_definitions() command.  The NEW behavior is
to behave as a normal user-defined directory property.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0060

Next topic

CMP0058

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0059

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0060 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0059" href="CMP0059.html" />
    <link rel="prev" title="CMP0061" href="CMP0061.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0060

CMP0060¶

New in version 3.3.

Link libraries by full path even in implicit directories.

Policy CMP0003 was introduced with the intention of always
linking library files by full path when a full path is given to the
target_link_libraries() command.  However, on some platforms
(e.g. HP-UX) the compiler front-end adds alternative library search paths
for the current architecture (e.g. /usr/lib/<arch> has alternatives
to libraries in /usr/lib for the current architecture).
On such platforms the find_library() may find a library such as
/usr/lib/libfoo.so that does not belong to the current architecture.

Prior to policy CMP0003 projects would still build in such
cases because the incorrect library path would be converted to -lfoo
on the link line and the linker would find the proper library in the
arch-specific search path provided by the compiler front-end implicitly.
At the time we chose to remain compatible with such projects by always
converting library files found in implicit link directories to -lfoo
flags to ask the linker to search for them.  This approach allowed existing
projects to continue to build while still linking to libraries outside
implicit link directories via full path (such as those in the build tree).

CMake does allow projects to override this behavior by using an
IMPORTED library target with its
IMPORTED_LOCATION property set to the desired full path to
a library file.  In fact, many Find Modules are learning to provide
Imported Targets instead of just the traditional Foo_LIBRARIES
variable listing library files.  However, this makes the link line
generated for a library found by a Find Module depend on whether it
is linked through an imported target or not, which is inconsistent.
Furthermore, this behavior has been a source of confusion because the
generated link line for a library file depends on its location.  It is
also problematic for projects trying to link statically because flags
like -Wl,-Bstatic -lfoo -Wl,-Bdynamic may be used to help the linker
select libfoo.a instead of libfoo.so but then leak dynamic linking
to following libraries.  (See the LINK_SEARCH_END_STATIC
target property for a solution typically used for that problem.)

When the special case for libraries in implicit link directories was first
introduced the list of implicit link directories was simply hard-coded
(e.g. /lib, /usr/lib, and a few others).  Since that time, CMake
has learned to detect the implicit link directories used by the compiler
front-end.  If necessary, the find_library() command could be
taught to use this information to help find libraries of the proper
architecture.

For these reasons, CMake 3.3 and above prefer to drop the special case
and link libraries by full path even when they are in implicit link
directories.  Policy CMP0060 provides compatibility for existing
projects.

The OLD behavior for this policy is to ask the linker to search for
libraries whose full paths are known to be in implicit link directories.
The NEW behavior for this policy is to link libraries by full path even
if they are in implicit link directories.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0060
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0061

Next topic

CMP0059

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0060

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0061 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0060" href="CMP0060.html" />
    <link rel="prev" title="CMP0062" href="CMP0062.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0061

CMP0061¶

New in version 3.3.

CTest does not by default tell make to ignore errors (-i).

The ctest_build() and build_command() commands no
longer generate build commands for Makefile Generators with
the -i option.  Previously this was done to help build as much
of tested projects as possible.  However, this behavior is not
consistent with other generators and also causes the return code
of the make tool to be meaningless.

Of course users may still add this option manually by setting
CTEST_BUILD_COMMAND or the MAKECOMMAND cache entry.
See the CTest Build Step MakeCommand setting documentation
for their effects.

The OLD behavior for this policy is to add -i to make
calls in CTest.  The NEW behavior for this policy is to not
add -i.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0062

Next topic

CMP0060

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0061

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0062 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0061" href="CMP0061.html" />
    <link rel="prev" title="CMP0063" href="CMP0063.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0062

CMP0062¶

New in version 3.3.

Disallow install() of export() result.

The export() command generates a file containing
Imported Targets, which is suitable for use from the build
directory.  It is not suitable for installation because it contains absolute
paths to buildsystem locations, and is particular to a single build
configuration.

The install(EXPORT) generates and installs files which contain
Imported Targets.  These files are generated with relative paths
(unless the user specifies absolute paths), and are designed for
multi-configuration use.  See Creating Packages for more.

CMake 3.3 no longer allows the use of the install(FILES) command
with the result of the export() command.

The OLD behavior for this policy is to allow installing the result of
an export() command.  The NEW behavior for this policy is
not to allow installing the result of an export() command.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0063

Next topic

CMP0061

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0062

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0063 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0062" href="CMP0062.html" />
    <link rel="prev" title="CMP0064" href="CMP0064.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0063

CMP0063¶

New in version 3.3.

Honor visibility properties for all target types.

The <LANG>_VISIBILITY_PRESET and
VISIBILITY_INLINES_HIDDEN target properties affect visibility
of symbols during dynamic linking.  When first introduced these properties
affected compilation of sources only in shared libraries, module libraries,
and executables with the ENABLE_EXPORTS property set.  This
was sufficient for the basic use cases of shared libraries and executables
with plugins.  However, some sources may be compiled as part of static
libraries or object libraries and then linked into a shared library later.
CMake 3.3 and above prefer to honor these properties for sources compiled
in all target types.  This policy preserves compatibility for projects
expecting the properties to work only for some target types.

The OLD behavior for this policy is to ignore the visibility properties
for static libraries, object libraries, and executables without exports.
The NEW behavior for this policy is to honor the visibility properties
for all target types.

This policy was introduced in CMake version 3.3.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0064

Next topic

CMP0062

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0063

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0064 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0063" href="CMP0063.html" />
    <link rel="prev" title="CMP0065" href="CMP0065.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0064

CMP0064¶

New in version 3.4.

Recognize TEST as a operator for the if() command.

The TEST operator was added to the if() command to determine if a
given test name was created by the add_test() command.

The OLD behavior for this policy is to ignore the TEST operator.
The NEW behavior is to interpret the TEST operator.

This policy was introduced in CMake version 3.4.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0065

Next topic

CMP0063

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0064

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0065 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0064" href="CMP0064.html" />
    <link rel="prev" title="CMP0066" href="CMP0066.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0065

CMP0065¶

New in version 3.4.

Do not add flags to export symbols from executables without
the ENABLE_EXPORTS target property.

CMake 3.3 and below, for historical reasons, always linked executables
on some platforms with flags like -rdynamic to export symbols from
the executables for use by any plugins they may load via dlopen.
CMake 3.4 and above prefer to do this only for executables that are
explicitly marked with the ENABLE_EXPORTS target property.

The OLD behavior of this policy is to always use the additional link
flags when linking executables regardless of the value of the
ENABLE_EXPORTS target property.

The NEW behavior of this policy is to only use the additional link
flags when linking executables if the ENABLE_EXPORTS target
property is set to True.

This policy was introduced in CMake version 3.4.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0065
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0066

Next topic

CMP0064

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0065

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0066 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0065" href="CMP0065.html" />
    <link rel="prev" title="CMP0067" href="CMP0067.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0066

CMP0066¶

New in version 3.7.

Honor per-config flags in try_compile() source-file signature.

The source file signature of the try_compile() command uses the value
of the CMAKE_<LANG>_FLAGS variable in the test project so that the
test compilation works as it would in the main project.  However, CMake 3.6 and
below do not also honor config-specific compiler flags such as those in the
CMAKE_<LANG>_FLAGS_DEBUG variable.  CMake 3.7 and above prefer to
honor config-specific compiler flags too.  This policy provides compatibility
for projects that do not expect config-specific compiler flags to be used.

The OLD behavior of this policy is to ignore config-specific flag
variables like CMAKE_<LANG>_FLAGS_DEBUG and only use CMake's
built-in defaults for the current compiler and platform.

The NEW behavior of this policy is to honor config-specific flag
variabldes like CMAKE_<LANG>_FLAGS_DEBUG.

This policy was introduced in CMake version 3.7.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0066
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0067

Next topic

CMP0065

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0066

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0067 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0066" href="CMP0066.html" />
    <link rel="prev" title="CMP0068" href="CMP0068.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0067

CMP0067¶

New in version 3.8.

Honor language standard in try_compile() source-file signature.

The try_compile() source file signature is intended to allow
callers to check whether they will be able to compile a given source file
with the current toolchain.  In order to match compiler behavior, any
language standard mode should match.  However, CMake 3.7 and below did not
do this.  CMake 3.8 and above prefer to honor the language standard settings
for C, CXX (C++), and CUDA using the values of the variables:

CMAKE_C_STANDARD

CMAKE_C_STANDARD_REQUIRED

CMAKE_C_EXTENSIONS

CMAKE_CXX_STANDARD

CMAKE_CXX_STANDARD_REQUIRED

CMAKE_CXX_EXTENSIONS

CMAKE_CUDA_STANDARD

CMAKE_CUDA_STANDARD_REQUIRED

CMAKE_CUDA_EXTENSIONS

This policy provides compatibility for projects that do not expect
the language standard settings to be used automatically.

The OLD behavior of this policy is to ignore language standard
setting variables when generating the try_compile test project.
The NEW behavior of this policy is to honor language standard
setting variables.

This policy was introduced in CMake version 3.8.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn by default, and uses OLD behavior.

See documentation of the
CMAKE_POLICY_WARNING_CMP0067
variable to control the warning.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0068

Next topic

CMP0066

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0067

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0068 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0067" href="CMP0067.html" />
    <link rel="prev" title="CMP0069" href="CMP0069.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0068

CMP0068¶

New in version 3.9.

RPATH settings on macOS do not affect install_name.

CMake 3.9 and newer remove any effect the following settings may have on the
install_name of a target on macOS:

BUILD_WITH_INSTALL_RPATH target property

SKIP_BUILD_RPATH target property

CMAKE_SKIP_RPATH variable

CMAKE_SKIP_INSTALL_RPATH variable

Previously, setting BUILD_WITH_INSTALL_RPATH had the effect of
setting both the install_name of a target to INSTALL_NAME_DIR
and the RPATH to INSTALL_RPATH.  In CMake 3.9, it only affects
setting of RPATH.  However, if one wants INSTALL_NAME_DIR to
apply to the target in the build tree, one may set
BUILD_WITH_INSTALL_NAME_DIR.

If SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH or
CMAKE_SKIP_INSTALL_RPATH were used to strip the directory portion
of the install_name of a target, one may set INSTALL_NAME_DIR=""
instead.

The OLD behavior of this policy is to use the RPATH settings for
install_name on macOS.  The NEW behavior of this policy is to ignore
the RPATH settings for install_name on macOS.

This policy was introduced in CMake version 3.9.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0069

Next topic

CMP0067

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0068

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0069 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0068" href="CMP0068.html" />
    <link rel="prev" title="CMP0070" href="CMP0070.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0069

CMP0069¶

New in version 3.9.

INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.

CMake 3.9 and newer prefer to add IPO flags whenever the
INTERPROCEDURAL_OPTIMIZATION target property is enabled and
produce an error if flags are not known to CMake for the current compiler.
Since a given compiler may not support IPO flags in all environments in which
it is used, it is now the project's responsibility to use the
CheckIPOSupported module to check for support before enabling the
INTERPROCEDURAL_OPTIMIZATION target property.  This approach
allows a project to conditionally activate IPO when supported.  It also
allows an end user to set the CMAKE_INTERPROCEDURAL_OPTIMIZATION
variable in an environment known to support IPO even if the project does
not enable the property.

Since CMake 3.8 and lower only honored INTERPROCEDURAL_OPTIMIZATION
for the Intel compiler on Linux, some projects may unconditionally enable the
target property.  Policy CMP0069 provides compatibility with such projects.

This policy takes effect whenever the IPO property is enabled.  The OLD
behavior for this policy is to add IPO flags only for Intel compiler on Linux.
The NEW behavior for this policy is to add IPO flags for the current
compiler or produce an error if CMake does not know the flags.

This policy was introduced in CMake version 3.9.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Examples¶

Behave like CMake 3.8 and do not apply any IPO flags except for Intel compiler
on Linux:

cmake_minimum_required(VERSION 3.8)
project(foo)

# ...

set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)

Use the CheckIPOSupported module to detect whether IPO is
supported by the current compiler, environment, and CMake version.
Produce a fatal error if support is not available:

cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
project(foo)

include(CheckIPOSupported)
check_ipo_supported()

# ...

set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)

Apply IPO flags only if compiler supports it:

cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
project(foo)

include(CheckIPOSupported)

# ...

check_ipo_supported(RESULT result)
if(result)
  set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

Apply IPO flags without any checks.  This may lead to build errors if IPO
is not supported by the compiler in the current environment.  Produce an
error if CMake does not know IPO flags for the current compiler:

cmake_minimum_required(VERSION 3.9) # CMP0069 NEW
project(foo)

# ...

set_property(TARGET ... PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)

Table of Contents

CMP0069

Examples

Previous topic

CMP0070

Next topic

CMP0068

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0069

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0070 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0069" href="CMP0069.html" />
    <link rel="prev" title="CMP0071" href="CMP0071.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0070

CMP0070¶

New in version 3.10.

Define file(GENERATE) behavior for relative paths.

CMake 3.10 and newer define that relative paths given to INPUT and
OUTPUT arguments of file(GENERATE) are interpreted relative to the
current source and binary directories, respectively.  CMake 3.9 and lower did
not define any behavior for relative paths but did not diagnose them either
and accidentally treated them relative to the process working directory.
Policy CMP0070 provides compatibility with projects that used the old
undefined behavior.

This policy affects behavior of relative paths given to file(GENERATE).
The OLD behavior for this policy is to treat the paths relative to the
working directory of CMake.  The NEW behavior for this policy is to
interpret relative paths with respect to the current source or binary
directory of the caller.

This policy was introduced in CMake version 3.10.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0071

Next topic

CMP0069

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0070

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0071 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0070" href="CMP0070.html" />
    <link rel="prev" title="CMP0072" href="CMP0072.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0071

CMP0071¶

New in version 3.10.

Let AUTOMOC and AUTOUIC process
GENERATED files.

Since version 3.10, CMake processes regular and GENERATED
source files in AUTOMOC and AUTOUIC.
In earlier CMake versions, only regular source files were processed.
GENERATED source files were ignored silently.

This policy affects how source files that are GENERATED
get treated in AUTOMOC and AUTOUIC.

The OLD behavior for this policy is to ignore GENERATED
source files in AUTOMOC and AUTOUIC.

The NEW behavior for this policy is to process GENERATED
source files in AUTOMOC and AUTOUIC just like regular
source files.

Note

To silence the CMP0071 warning source files can be excluded from
AUTOMOC and AUTOUIC processing by setting the
source file properties SKIP_AUTOMOC, SKIP_AUTOUIC or
SKIP_AUTOGEN.

Source skip example:

# ...
set_property(SOURCE /path/to/file1.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE /path/to/file2.h PROPERTY SKIP_AUTOUIC ON)
set_property(SOURCE /path/to/file3.h PROPERTY SKIP_AUTOGEN ON)
# ...

This policy was introduced in CMake version 3.10.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0072

Next topic

CMP0070

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0071

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0072 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0071" href="CMP0071.html" />
    <link rel="prev" title="CMP0073" href="CMP0073.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0072

CMP0072¶

New in version 3.11.

FindOpenGL prefers GLVND by default when available.

The FindOpenGL module provides an OpenGL::GL target and an
OPENGL_LIBRARIES variable for projects to use for legacy GL interfaces.
When both a legacy GL library (e.g. libGL.so) and GLVND libraries
for OpenGL and GLX (e.g. libOpenGL.so and libGLX.so) are available,
the module must choose between them.  It documents an OpenGL_GL_PREFERENCE
variable that can be used to specify an explicit preference.  When no such
preference is set, the module must choose a default preference.

CMake 3.11 and above prefer to choose GLVND libraries.  This policy provides
compatibility with projects that expect the legacy GL library to be used.

The OLD behavior for this policy is to set OpenGL_GL_PREFERENCE to
LEGACY.  The NEW behavior for this policy is to set
OpenGL_GL_PREFERENCE to GLVND.

This policy was introduced in CMake version 3.11.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0073

Next topic

CMP0071

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0072

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0073 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0072" href="CMP0072.html" />
    <link rel="prev" title="CMP0074" href="CMP0074.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0073

CMP0073¶

New in version 3.12.

Do not produce legacy _LIB_DEPENDS cache entries.

Ancient CMake versions once used <tgt>_LIB_DEPENDS cache entries to
propagate library link dependencies.  This has long been done by other
means, leaving the export_library_dependencies() command as the
only user of these values.  That command has long been disallowed by
policy CMP0033, but the <tgt>_LIB_DEPENDS cache entries
were left for compatibility with possible non-standard uses by projects.

CMake 3.12 and above now prefer to not produce these cache entries
at all.  This policy provides compatibility with projects that have
not been updated to avoid using them.

The OLD behavior for this policy is to set <tgt>_LIB_DEPENDS cache
entries.  The NEW behavior for this policy is to not set them.

This policy was introduced in CMake version 3.12.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake does not warn, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0074

Next topic

CMP0072

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0073

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0074 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0073" href="CMP0073.html" />
    <link rel="prev" title="CMP0075" href="CMP0075.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0074

CMP0074¶

New in version 3.12.

find_package() uses <PackageName>_ROOT variables.

In CMake 3.12 and above the find_package(<PackageName>) command now
searches prefixes specified by the <PackageName>_ROOT CMake
variable and the <PackageName>_ROOT environment variable.
Package roots are maintained as a stack so nested calls to all find_*
commands inside find modules and config packages also search the roots as
prefixes.  This policy provides compatibility with projects that have not been
updated to avoid using <PackageName>_ROOT variables for other purposes.

The OLD behavior for this policy is to ignore <PackageName>_ROOT
variables.  The NEW behavior for this policy is to use
<PackageName>_ROOT variables.

This policy was introduced in CMake version 3.12.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0075

Next topic

CMP0073

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0074

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>CMP0075 — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMP0074" href="CMP0074.html" />
    <link rel="prev" title="CMP0076" href="CMP0076.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0075

CMP0075¶

New in version 3.12.

Include file check macros honor CMAKE_REQUIRED_LIBRARIES.

In CMake 3.12 and above, the

check_include_file macro in the CheckIncludeFile module, the

check_include_file_cxx macro in the
CheckIncludeFileCXX module, and the

check_include_files macro in the CheckIncludeFiles module

now prefer to link the check executable to the libraries listed in the
CMAKE_REQUIRED_LIBRARIES variable.  This policy provides compatibility
with projects that have not been updated to expect this behavior.

The OLD behavior for this policy is to ignore CMAKE_REQUIRED_LIBRARIES
in the include file check macros.  The NEW behavior of this policy is to
honor CMAKE_REQUIRED_LIBRARIES in the include file check macros.

This policy was introduced in CMake version 3.12.
It may be set by cmake_policy() or cmake_minimum_required().
If it is not set, CMake warns, and uses OLD behavior.

Note

The OLD behavior of a policy is
deprecated by definition
and may be removed in a future version of CMake.

Previous topic

CMP0076

Next topic

CMP0074

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-policies(7) »

CMP0075

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.