summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeCommand.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/cmIncludeCommand.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/cmIncludeCommand.h')
-rw-r--r--Source/cmIncludeCommand.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmIncludeCommand.h b/Source/cmIncludeCommand.h
index aaeea39..89df06c 100644
--- a/Source/cmIncludeCommand.h
+++ b/Source/cmIncludeCommand.h
@@ -69,8 +69,8 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " include(file1 [OPTIONAL] [RESULT_VARIABLE <VAR>])\n"
- " include(module [OPTIONAL] [RESULT_VARIABLE <VAR>])\n"
+ " include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]\n"
+ " [NO_POLICY_SCOPE])\n"
"Reads CMake listfile code from the given file. Commands in the file "
"are processed immediately as if they were written in place of the "
"include command. If OPTIONAL is present, then no error "
@@ -78,7 +78,11 @@ public:
"the variable will be set to the full filename which "
"has been included or NOTFOUND if it failed.\n"
"If a module is specified instead of a file, the file with name "
- "<modulename>.cmake is searched in the CMAKE_MODULE_PATH.";
+ "<modulename>.cmake is searched in the CMAKE_MODULE_PATH."
+ "\n"
+ "See the cmake_policy() command documentation for discussion of the "
+ "NO_POLICY_SCOPE option."
+ ;
}
cmTypeMacro(cmIncludeCommand, cmCommand);