summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakePolicyCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-18 13:53:06 (GMT)
committerBrad King <brad.king@kitware.com>2008-08-18 13:53:06 (GMT)
commit7f7068e9d48666ce58f6ba9455a52e7fadee9d6f (patch)
tree13a69737cb6d663ea7b055b0d0d8bb5bdbccf5e7 /Source/cmCMakePolicyCommand.h
parentf2d2a82cd0030315e91307fa3a306a947e938d29 (diff)
downloadCMake-7f7068e9d48666ce58f6ba9455a52e7fadee9d6f.zip
CMake-7f7068e9d48666ce58f6ba9455a52e7fadee9d6f.tar.gz
CMake-7f7068e9d48666ce58f6ba9455a52e7fadee9d6f.tar.bz2
ENH: Add cmake_policy(GET) command mode
It is likely that projects or CMake modules in the future will need to check the value of a policy setting. For example, if we add a policy that affects the results of FindXYZ.cmake modules, the module code will need to be able to check the policy.
Diffstat (limited to 'Source/cmCMakePolicyCommand.h')
-rw-r--r--Source/cmCMakePolicyCommand.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index 54c494c..e478811 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -108,6 +108,11 @@ public:
"Alternatively one may fix the project to work with the new behavior "
"and set the policy state to NEW."
"\n"
+ " cmake_policy(GET CMP<NNNN> <variable>)\n"
+ "Check whether a given policy is set to OLD or NEW behavior. "
+ "The output variable value will be \"OLD\" or \"NEW\" if the "
+ "policy is set, and empty otherwise."
+ "\n"
" cmake_policy(PUSH)\n"
" cmake_policy(POP)\n"
"Push and pop the current policy setting state on a stack. "
@@ -123,6 +128,7 @@ public:
cmTypeMacro(cmCMakePolicyCommand, cmCommand);
private:
bool HandleSetMode(std::vector<std::string> const& args);
+ bool HandleGetMode(std::vector<std::string> const& args);
bool HandleVersionMode(std::vector<std::string> const& args);
};