summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-21 11:58:48 -0400
committerBrad King <brad.king@kitware.com>2013-10-22 09:09:52 -0400
commit3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c (patch)
tree2d0ca3ea70083bd9d7f19ffc4b2f246ad87ede17 /Source
parent178b9af18674b23be97758236c676c9bd9398c40 (diff)
downloadcmake-3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c.tar.gz
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 f830806bd3..aad088bfe3 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 ae1ccc12ca..29ff1e3daa 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 747e9be5ee..ddb40034e9 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 1032745ad9..881b149960 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; }
};