summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-21 17:12:18 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-22 13:09:53 (GMT)
commit6c9194488aa5d61774ffeb40f54149ce2255f00c (patch)
treefc1200e03d64e3a83893de34814d3c244cfb6d54 /Source
parent3969bb23aafcdbd2174649e8eeb8f7b0e7ea6c4c (diff)
downloadCMake-6c9194488aa5d61774ffeb40f54149ce2255f00c.zip
CMake-6c9194488aa5d61774ffeb40f54149ce2255f00c.tar.gz
CMake-6c9194488aa5d61774ffeb40f54149ce2255f00c.tar.bz2
Add policy CMP0036 to disallow build_name
Diffstat (limited to 'Source')
-rw-r--r--Source/cmBuildNameCommand.cxx3
-rw-r--r--Source/cmBuildNameCommand.h38
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
4 files changed, 13 insertions, 34 deletions
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index f95a79e..e3528e1 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -17,6 +17,9 @@
bool cmBuildNameCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{
+ if(this->Disallowed(cmPolicies::CMP0036,
+ "The build_name command should not be called; see CMP0036."))
+ { return true; }
if(args.size() < 1 )
{
this->SetError("called with incorrect number of arguments");
diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h
index faeb3c0..2f7acde 100644
--- a/Source/cmBuildNameCommand.h
+++ b/Source/cmBuildNameCommand.h
@@ -14,46 +14,16 @@
#include "cmCommand.h"
-/** \class cmBuildNameCommand
- * \brief build_name command
- *
- * cmBuildNameCommand implements the build_name CMake command
- */
class cmBuildNameCommand : public cmCommand
{
public:
- /**
- * This is a virtual constructor for the command.
- */
- virtual cmCommand* Clone()
- {
- return new cmBuildNameCommand;
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
+ cmTypeMacro(cmBuildNameCommand, cmCommand);
+ virtual cmCommand* Clone() { return new cmBuildNameCommand; }
virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status);
-
- /**
- * This determines if the command is invoked when in script mode.
- */
- virtual bool IsScriptable() const { return true; }
-
- /**
- * The name of the command as specified in CMakeList.txt.
- */
virtual const char* GetName() const {return "build_name";}
-
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
- cmTypeMacro(cmBuildNameCommand, cmCommand);
+ virtual bool IsScriptable() const { return true; }
+ virtual bool IsDiscouraged() const { return true; }
};
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index aad088b..c05de17 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -281,6 +281,11 @@ cmPolicies::cmPolicies()
CMP0035, "CMP0035",
"The variable_requires command should not be called.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0036, "CMP0036",
+ "The build_name command should not be called.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 29ff1e3..9e72bdc 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -87,6 +87,7 @@ public:
CMP0033, ///< Disallow command: export_library_dependencies
CMP0034, ///< Disallow command: utility_source
CMP0035, ///< Disallow command: variable_requires
+ CMP0036, ///< Disallow command: build_name
/** \brief Always the last entry.
*