summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-18 16:41:54 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-22 13:09:52 (GMT)
commitaa76518f8bfd821f000d1779066eb7614cdd079b (patch)
tree4005fa79df546cbf0de9bfb2f0610b27a9b65c3d /Source
parent97268cf5b7626febb06d04c2201ace397a4863fd (diff)
downloadCMake-aa76518f8bfd821f000d1779066eb7614cdd079b.zip
CMake-aa76518f8bfd821f000d1779066eb7614cdd079b.tar.gz
CMake-aa76518f8bfd821f000d1779066eb7614cdd079b.tar.bz2
Add policy CMP0031 to disallow load_command
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLoadCommandCommand.cxx3
-rw-r--r--Source/cmLoadCommandCommand.h24
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
4 files changed, 11 insertions, 22 deletions
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 84dd299..21ee0fe 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -189,6 +189,9 @@ cmLoadedCommand::~cmLoadedCommand()
bool cmLoadCommandCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{
+ if(this->Disallowed(cmPolicies::CMP0031,
+ "The load_command command should not be called; see CMP0031."))
+ { return true; }
if(args.size() < 1 )
{
return true;
diff --git a/Source/cmLoadCommandCommand.h b/Source/cmLoadCommandCommand.h
index 918f32b..11bcf09 100644
--- a/Source/cmLoadCommandCommand.h
+++ b/Source/cmLoadCommandCommand.h
@@ -14,34 +14,14 @@
#include "cmCommand.h"
-/** \class cmLoadCommandCommand
- * \brief Load in a Command plugin
- *
- * cmLoadCommandCommand loads a command into CMake
- */
class cmLoadCommandCommand : public cmCommand
{
public:
- /**
- * This is a virtual constructor for the command.
- */
- virtual cmCommand* Clone()
- {
- return new cmLoadCommandCommand;
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
+ virtual cmCommand* Clone() { return new cmLoadCommandCommand; }
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 "load_command";}
-
+ virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmLoadCommandCommand, cmCommand);
};
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index fdd3bd0..03e898e 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -256,6 +256,11 @@ cmPolicies::cmPolicies()
CMP0030, "CMP0030",
"The use_mangled_mesa command should not be called.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0031, "CMP0031",
+ "The load_command command should not be called.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 6de168e..597296b 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -82,6 +82,7 @@ public:
CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target.
CMP0029, ///< Disallow command: subdir_depends
CMP0030, ///< Disallow command: use_mangled_mesa
+ CMP0031, ///< Disallow command: load_command
/** \brief Always the last entry.
*