summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-12-20 14:41:52 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-12-20 14:41:52 (GMT)
commit6820882be57942403fa7eaf706a0169fd2816fc2 (patch)
treeca08bfc749a4c41eb1c035826ffc24a07fbd5026 /Help
parent053c39c4d9351d57e73f32070508bb4530bef33a (diff)
parent8f849b90711e0912fa81018058a53eb193dd678c (diff)
downloadCMake-6820882be57942403fa7eaf706a0169fd2816fc2.zip
CMake-6820882be57942403fa7eaf706a0169fd2816fc2.tar.gz
CMake-6820882be57942403fa7eaf706a0169fd2816fc2.tar.bz2
Merge topic 'extend-policies-manual'
8f849b9 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