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
CMP0180project()will always set the<PROJECT_NAME>_*values as normal variables.CMP0177- TODO
CMP0176- TODO
CMP0175- TODO
CMP0174- TODO
CMP0172- TODO
CMP0171codegenis a reserved target name.CMP0160- More read only properties not error when trying to set them.
CMP0144find_packagesupports upper-casePACKAGENAME_ROOTvariables.CMP0130while()diagnoses condition evaluation errors.CMP0125find_<...>()functions have consistent cache variable behavior.CMP0124foreach()loop variables are scoped.CMP0121list()detects invalid indicesCMP0116- Ninja transforms
DEPFILESinadd_custom_command. CMP0092- MSVC warning flags are removed by default.
CMP0091- MSVC uses the
CMAKE_MSVC_RUNTIME_LIBRARYvariable. CMP0090export(PACKAGE)does not populate package registry.CMP0077option()honors normal variables.