summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-18 15:54:48 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-22 13:09:51 (GMT)
commit9f64fbf5b5f128580639f14e232430194c9326f1 (patch)
tree0f83aa908222265eb0bcd69c19ac2264bb8b19a1 /Source
parent882c0f0b698e70be8b74aa498b62cb1fb22f3c24 (diff)
downloadCMake-9f64fbf5b5f128580639f14e232430194c9326f1.zip
CMake-9f64fbf5b5f128580639f14e232430194c9326f1.tar.gz
CMake-9f64fbf5b5f128580639f14e232430194c9326f1.tar.bz2
Add policy CMP0029 to disallow subdir_depends
Diffstat (limited to 'Source')
-rw-r--r--Source/cmPolicies.cxx5
-rw-r--r--Source/cmPolicies.h1
-rw-r--r--Source/cmSubdirDependsCommand.cxx4
-rw-r--r--Source/cmSubdirDependsCommand.h34
4 files changed, 10 insertions, 34 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index f7efc1e..fcc5bfc 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -246,6 +246,11 @@ cmPolicies::cmPolicies()
CMP0028, "CMP0028",
"Double colon in target name means ALIAS or IMPORTED target.",
3,0,0,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0029, "CMP0029",
+ "The subdir_depends command should not be called.",
+ 3,0,0,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 68cd7c2..343c01d 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -80,6 +80,7 @@ public:
CMP0027, ///< Conditionally linked imported targets with missing include
/// directories.
CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target.
+ CMP0029, ///< Disallow command: subdir_depends
/** \brief Always the last entry.
*
diff --git a/Source/cmSubdirDependsCommand.cxx b/Source/cmSubdirDependsCommand.cxx
index 2af7bf1..9381983 100644
--- a/Source/cmSubdirDependsCommand.cxx
+++ b/Source/cmSubdirDependsCommand.cxx
@@ -11,10 +11,10 @@
============================================================================*/
#include "cmSubdirDependsCommand.h"
-// cmSubdirDependsCommand
bool cmSubdirDependsCommand::InitialPass(std::vector<std::string> const& ,
cmExecutionStatus &)
{
+ this->Disallowed(cmPolicies::CMP0029,
+ "The subdir_depends command should not be called; see CMP0029.");
return true;
}
-
diff --git a/Source/cmSubdirDependsCommand.h b/Source/cmSubdirDependsCommand.h
index e6f1f8f..f78cfb7 100644
--- a/Source/cmSubdirDependsCommand.h
+++ b/Source/cmSubdirDependsCommand.h
@@ -14,45 +14,15 @@
#include "cmCommand.h"
-/** \class cmSubdirDependsCommand
- * \brief Legacy command. Do not use.
- *
- * cmSubdirDependsCommand has been left in CMake for compatability with
- * projects already using it. Its functionality in supporting parallel
- * builds is now automatic. The command does not do anything.
- */
class cmSubdirDependsCommand : public cmCommand
{
public:
- /**
- * This is a virtual constructor for the command.
- */
- virtual cmCommand* Clone()
- {
- return new cmSubdirDependsCommand;
- }
-
- /**
- * This is called when the command is first encountered in
- * the CMakeLists.txt file.
- */
+ virtual cmCommand* Clone() { return new cmSubdirDependsCommand; }
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 "subdir_depends";}
-
- /** This command is kept for compatibility with older CMake versions. */
- virtual bool IsDiscouraged() const
- {
- return true;
- }
-
+ virtual bool IsDiscouraged() const { return true; }
cmTypeMacro(cmSubdirDependsCommand, cmCommand);
};
-
-
#endif