mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 21:30:01 -05:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user