diff options
author | Brad King <brad.king@kitware.com> | 2013-10-18 15:55:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-22 13:09:51 (GMT) |
commit | 97268cf5b7626febb06d04c2201ace397a4863fd (patch) | |
tree | 959cacfbee953a25a5cb3aad0cd53b5052a4aa40 | |
parent | 9f64fbf5b5f128580639f14e232430194c9326f1 (diff) | |
download | CMake-97268cf5b7626febb06d04c2201ace397a4863fd.zip CMake-97268cf5b7626febb06d04c2201ace397a4863fd.tar.gz CMake-97268cf5b7626febb06d04c2201ace397a4863fd.tar.bz2 |
Add policy CMP0030 to disallow use_mangled_mesa
-rw-r--r-- | Help/command/use_mangled_mesa.rst | 2 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 | ||||
-rw-r--r-- | Help/policy/CMP0030.rst | 11 | ||||
-rw-r--r-- | Source/cmPolicies.cxx | 5 | ||||
-rw-r--r-- | Source/cmPolicies.h | 1 | ||||
-rw-r--r-- | Source/cmUseMangledMesaCommand.cxx | 4 | ||||
-rw-r--r-- | Source/cmUseMangledMesaCommand.h | 39 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt | 12 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake | 1 |
17 files changed, 54 insertions, 38 deletions
diff --git a/Help/command/use_mangled_mesa.rst b/Help/command/use_mangled_mesa.rst index a4d77e9..6f4d7ac 100644 --- a/Help/command/use_mangled_mesa.rst +++ b/Help/command/use_mangled_mesa.rst @@ -1,6 +1,8 @@ use_mangled_mesa ---------------- +Disallowed. See CMake Policy :policy:`CMP0030`. + Copy mesa headers for use in combination with system GL. :: diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index d58fabc..c1251f0 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -59,3 +59,4 @@ All Policies /policy/CMP0027 /policy/CMP0028 /policy/CMP0029 + /policy/CMP0030 diff --git a/Help/policy/CMP0030.rst b/Help/policy/CMP0030.rst new file mode 100644 index 0000000..6fcffc3 --- /dev/null +++ b/Help/policy/CMP0030.rst @@ -0,0 +1,11 @@ +CMP0030 +------- + +The :command:`use_mangled_mesa` command should not be called. + +This command was created in September 2001 to support VTK before +modern CMake language and custom command capabilities. VTK has +not used it in years. + +.. |disallowed_version| replace:: 3.0.0 +.. include:: DISALLOWED_COMMAND.txt diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index fcc5bfc..fdd3bd0 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -251,6 +251,11 @@ cmPolicies::cmPolicies() CMP0029, "CMP0029", "The subdir_depends command should not be called.", 3,0,0,0, cmPolicies::WARN); + + this->DefinePolicy( + CMP0030, "CMP0030", + "The use_mangled_mesa command should not be called.", + 3,0,0,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 343c01d..6de168e 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -81,6 +81,7 @@ public: /// directories. CMP0028, ///< Double colon in target name means ALIAS or IMPORTED target. CMP0029, ///< Disallow command: subdir_depends + CMP0030, ///< Disallow command: use_mangled_mesa /** \brief Always the last entry. * diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index 4c189e6..1bd579d 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -14,10 +14,12 @@ #include <cmsys/RegularExpression.hxx> -// cmUseMangledMesaCommand bool cmUseMangledMesaCommand ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &) { + if(this->Disallowed(cmPolicies::CMP0030, + "The use_mangled_mesa command should not be called; see CMP0030.")) + { return true; } // expected two arguments: // arguement one: the full path to gl_mangle.h // arguement two : directory for output of edited headers diff --git a/Source/cmUseMangledMesaCommand.h b/Source/cmUseMangledMesaCommand.h index aac7814..dca75a5 100644 --- a/Source/cmUseMangledMesaCommand.h +++ b/Source/cmUseMangledMesaCommand.h @@ -14,54 +14,19 @@ #include "cmCommand.h" -#include "cmSourceFile.h" - -/** \class cmUseMangledMesaCommand - * \brief Create Tcl Wrappers for VTK classes. - * - * cmUseMangledMesaCommand is used to define a CMake variable include - * path location by specifying a file and list of directories. - */ class cmUseMangledMesaCommand : public cmCommand { public: cmTypeMacro(cmUseMangledMesaCommand, cmCommand); - - /** - * This is a virtual constructor for the command. - */ - virtual cmCommand* Clone() - { - return new cmUseMangledMesaCommand; - } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ + virtual cmCommand* Clone() { return new cmUseMangledMesaCommand; } 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 "use_mangled_mesa";} - - /** - * This determines if the command is invoked when in script mode. - */ virtual bool IsScriptable() const { return true; } - - /** This command is kept for compatibility with older CMake versions. */ - virtual bool IsDiscouraged() const - { - return true; - } - + virtual bool IsDiscouraged() const { return true; } protected: void CopyAndFullPathMesaHeader(const char* source, const char* outdir); }; - #endif diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt new file mode 100644 index 0000000..cb380db --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0030-NEW.cmake:2 \(use_mangled_mesa\): + The use_mangled_mesa command should not be called; see CMP0030. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake new file mode 100644 index 0000000..73365a7 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0030 NEW) +use_mangled_mesa() diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt new file mode 100644 index 0000000..e95e16f --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\): + use_mangled_mesa called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake new file mode 100644 index 0000000..efbb852 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0030 OLD) +use_mangled_mesa() diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt new file mode 100644 index 0000000..db3c23f13 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN-stderr.txt @@ -0,0 +1,12 @@ +CMake Warning \(dev\) at CMP0030-WARN.cmake:1 \(use_mangled_mesa\): + Policy CMP0030 is not set: The use_mangled_mesa command should not be + called. Run "cmake --help-policy CMP0030" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Error at CMP0030-WARN.cmake:1 \(use_mangled_mesa\): + use_mangled_mesa called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake new file mode 100644 index 0000000..cbe0ff0 --- /dev/null +++ b/Tests/RunCMake/DisallowedCommands/CMP0030-WARN.cmake @@ -0,0 +1 @@ +use_mangled_mesa() diff --git a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake index 50911ac..1945210 100644 --- a/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake +++ b/Tests/RunCMake/DisallowedCommands/RunCMakeTest.cmake @@ -2,6 +2,7 @@ include(RunCMake) foreach(p CMP0029 + CMP0030 ) run_cmake(${p}-WARN) run_cmake(${p}-OLD) |