Policies
CMake's policy system allows for backwards compatibility with older CMake implementations, allowing for older projects to "just work" out of the box. However, when including these older projects as children, policy scoping may end up being incorrect, and even if a given policy was set manually by a parent project, the policy might be ignored.
However CMake provides an escape hatch to set default values for policies when entering a "fresh" policy state. This escape hatch relies on a user setting the CMAKE_POLICY_DEFAULT_CMP<Policy Number Here>
variable.
Some policy values are absolutely necessary to be defaulted simply for user's sanity and IXM does this to ensure that anyone calling add_subdirectory
on a subproject is guaranteed some specific behavior. Every policy documented below is set to the NEW
value.
CMP0180
- De-duplication of static libraries on link lines keeps first occurrence
CMP0180
project()
will always set the<PROJECT_NAME>_*
values as normal variables.CMP0177
- TODO
CMP0176
- TODO
CMP0175
- TODO
CMP0174
- TODO
CMP0172
- TODO
CMP0171
codegen
is a reserved target name.CMP0160
- More read only properties not error when trying to set them.
CMP0144
find_package
supports upper-casePACKAGENAME_ROOT
variables.CMP0130
while()
diagnoses condition evaluation errors.CMP0125
find_<...>()
functions have consistent cache variable behavior.CMP0124
foreach()
loop variables are scoped.CMP0121
list()
detects invalid indicesCMP0116
- Ninja transforms
DEPFILES
inadd_custom_command
. CMP0092
- MSVC warning flags are removed by default.
CMP0091
- MSVC uses the
CMAKE_MSVC_RUNTIME_LIBRARY
variable. CMP0090
export(PACKAGE)
does not populate package registry.CMP0077
option()
honors normal variables.