diff options
author | Brad King <brad.king@kitware.com> | 2013-10-21 15:50:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-22 13:09:52 (GMT) |
commit | 178b9af18674b23be97758236c676c9bd9398c40 (patch) | |
tree | 657c6451d32cc4893b601214066d17512c9a62e9 /Source | |
parent | 248d1dc057564dc00e3374d7797a1e42ea57032d (diff) | |
download | CMake-178b9af18674b23be97758236c676c9bd9398c40.zip CMake-178b9af18674b23be97758236c676c9bd9398c40.tar.gz CMake-178b9af18674b23be97758236c676c9bd9398c40.tar.bz2 |
Add policy CMP0034 to disallow utility_source
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmPolicies.cxx | 5 | ||||
-rw-r--r-- | Source/cmPolicies.h | 1 | ||||
-rw-r--r-- | Source/cmUtilitySourceCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmUtilitySourceCommand.h | 39 |
4 files changed, 12 insertions, 36 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 7852d9a..f830806 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -271,6 +271,11 @@ cmPolicies::cmPolicies() CMP0033, "CMP0033", "The export_library_dependencies command should not be called.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0034, "CMP0034", + "The utility_source command should not be called.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 99982c4..ae1ccc1 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -85,6 +85,7 @@ public: CMP0031, ///< Disallow command: load_command CMP0032, ///< Disallow command: output_required_files CMP0033, ///< Disallow command: export_library_dependencies + CMP0034, ///< Disallow command: utility_source /** \brief Always the last entry. * diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 6ea3dfa..11e5108 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -15,6 +15,9 @@ bool cmUtilitySourceCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { + if(this->Disallowed(cmPolicies::CMP0034, + "The utility_source command should not be called; see CMP0034.")) + { return true; } if(args.size() < 3) { this->SetError("called with incorrect number of arguments"); diff --git a/Source/cmUtilitySourceCommand.h b/Source/cmUtilitySourceCommand.h index 0a0653c..83d115c 100644 --- a/Source/cmUtilitySourceCommand.h +++ b/Source/cmUtilitySourceCommand.h @@ -14,48 +14,15 @@ #include "cmCommand.h" -/** \class cmUtilitySourceCommand - * \brief A command to setup a cache entry with the location of a third-party - * utility's source. - * - * cmUtilitySourceCommand is used when a third-party utility's source is - * included in the project's source tree. It specifies the location of - * the executable's source, and any files that may be needed to confirm the - * identity of the source. - */ class cmUtilitySourceCommand : public cmCommand { public: - /** - * This is a virtual constructor for the command. - */ - virtual cmCommand* Clone() - { - return new cmUtilitySourceCommand; - } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ + cmTypeMacro(cmUtilitySourceCommand, cmCommand); + virtual cmCommand* Clone() { return new cmUtilitySourceCommand; } 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 "utility_source";} - - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - - - cmTypeMacro(cmUtilitySourceCommand, cmCommand); + virtual bool IsDiscouraged() const { return true; } }; - - #endif |