summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-21 15:58:48 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-22 13:09:52 (GMT)
commit3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c (patch)
tree2d0ca3ea70083bd9d7f19ffc4b2f246ad87ede17 /Source
parent178b9af18674b23be97758236c676c9bd9398c40 (diff)
downloadCMake-3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c.zip
CMake-3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c.tar.gz
CMake-3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c.tar.bz2
Add policy CMP0035 to disallow variable_requires
Diffstat (limited to 'Source')
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmVariableRequiresCommand.cxx3
-rw-r--r--Source/cmVariableRequiresCommand.h31
4 files changed, 12 insertions, 28 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index f830806..aad088b 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -276,6 +276,11 @@ cmPolicies::cmPolicies()
CMP0034, "CMP0034",
"The utility_source command should not be called.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0035, "CMP0035",
+ "The variable_requires command should not be called.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index ae1ccc1..29ff1e3 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -86,6 +86,7 @@ public:
CMP0032, ///< Disallow command: output_required_files
CMP0033, ///< Disallow command: export_library_dependencies
CMP0034, ///< Disallow command: utility_source
+ CMP0035, ///< Disallow command: variable_requires
/** \brief Always the last entry.
*
diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx
index 747e9be..ddb4003 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -16,6 +16,9 @@
bool cmVariableRequiresCommand
::InitialPass(std::vector<std::string>const& args, cmExecutionStatus &)
{
+ if(this->Disallowed(cmPolicies::CMP0035,
+ "The variable_requires command should not be called; see CMP0035."))
+ { return true; }
if(args.size() < 3 )
{
this->SetError("called with incorrect number of arguments");
diff --git a/Source/cmVariableRequiresCommand.h b/Source/cmVariableRequiresCommand.h
index 1032745..881b149 100644
--- a/Source/cmVariableRequiresCommand.h
+++ b/Source/cmVariableRequiresCommand.h
@@ -14,40 +14,15 @@
#include "cmCommand.h"
-/** \class cmVariableRequiresCommand
- * \brief Displays a message to the user
- *
- */
class cmVariableRequiresCommand : public cmCommand
{
public:
- /**
- * This is a virtual constructor for the command.
- */
- virtual cmCommand* Clone()
- {
- return new cmVariableRequiresCommand;
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
+ cmTypeMacro(cmVariableRequiresCommand, cmCommand);
+ virtual cmCommand* Clone() { return new cmVariableRequiresCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
- /**
- * The name of the command as specified in CMakeList.txt.
- */
virtual const char* GetName() const { return "variable_requires";}
-
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
- cmTypeMacro(cmVariableRequiresCommand, cmCommand);
+ virtual bool IsDiscouraged() const { return true; }
};