summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePolicyCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-22 18:18:40 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-22 18:18:40 (GMT)
commitc332e0bf3c4e619358322bd0d0961af45653eb5b (patch)
tree3e31da4052687557169b0e8da2cf897f42cbcb63 /Source/cmCMakePolicyCommand.h
parent3028ca756c8621b3cc37032987eb01fbe61da248 (diff)
downloadCMake-c332e0bf3c4e619358322bd0d0961af45653eb5b.zip
CMake-c332e0bf3c4e619358322bd0d0961af45653eb5b.tar.gz
CMake-c332e0bf3c4e619358322bd0d0961af45653eb5b.tar.bz2
ENH: Isolate policy changes in included scripts
Isolation of policy changes inside scripts is important for protecting the including context. This teaches include() and find_package() to imply a cmake_policy(PUSH) and cmake_policy(POP) around the scripts they load, with a NO_POLICY_SCOPE option to disable the behavior. This also creates CMake Policy CMP0011 to provide compatibility. See issue #8192.
Diffstat (limited to 'Source/cmCMakePolicyCommand.h')
-rw-r--r--Source/cmCMakePolicyCommand.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index e74a6cf..1f70247 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -117,6 +117,9 @@ public:
"cmake_policy command affect only the top of the stack. "
"A new entry on the policy stack is managed automatically for each "
"subdirectory to protect its parents and siblings. "
+ "CMake also manages a new entry for scripts loaded by include() and "
+ "find_package() commands except when invoked with the NO_POLICY_SCOPE "
+ "option (see also policy CMP0011). "
"The cmake_policy command provides an interface to manage custom "
"entries on the policy stack:\n"
" cmake_policy(PUSH)\n"