summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-20 11:19:11 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-12-20 11:32:43 (GMT)
commit8f849b90711e0912fa81018058a53eb193dd678c (patch)
tree64091a091c2d85914127b241d46ed8fbbd2f0929 /Help
parenta0ce1e36b6d3a117ebf51d1d803a129cf657321e (diff)
downloadCMake-8f849b90711e0912fa81018058a53eb193dd678c.zip
CMake-8f849b90711e0912fa81018058a53eb193dd678c.tar.gz
CMake-8f849b90711e0912fa81018058a53eb193dd678c.tar.bz2
Help: Mention if(POLICY) and NO_POLICY_SCOPE in policies manual.
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst16
1 files changed, 15 insertions, 1 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 5e94f89..9e26392 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -21,7 +21,21 @@ for a policy, also avoiding the warning.
The :command:`cmake_minimum_required` command does more than report an
error if a too-old version of CMake is used to build a project. It
also sets all policies introduced in that CMake version or earlier to
-NEW behavior.
+NEW behavior. To manage policies without increasing the minimum required
+CMake version, the :command:`if(POLICY)` command may be used::
+
+ if(POLICY CMP0990)
+ cmake_policy(SET CMP0990 NEW)
+ endif()
+
+This has the effect of using the NEW behavior with newer CMake releases which
+users may be using and not issuing a compatibility warning.
+
+The setting of a policy is confined in some cases to not propagate to the
+parent scope. For example, if the files read by the :command:`include` command
+or the :command:`find_package` command contain a use of :command:`cmake_policy`,
+that policy setting will not affect the caller by default. Both commands accept
+an optional ``NO_POLICY_SCOPE`` keyword to control this behavior.
The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or