Commit 97268cf5 authored by Brad King's avatar Brad King

Add policy CMP0030 to disallow use_mangled_mesa

parent 9f64fbf5
use_mangled_mesa
----------------
Disallowed. See CMake Policy :policy:`CMP0030`.
Copy mesa headers for use in combination with system GL.
::
......
......@@ -59,3 +59,4 @@ All Policies
/policy/CMP0027
/policy/CMP0028
/policy/CMP0029
/policy/CMP0030
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
......@@ -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()
......
......@@ -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.
*
......
......@@ -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
......
......@@ -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
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\)
cmake_policy(SET CMP0030 NEW)
use_mangled_mesa()
^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\)$
cmake_policy(SET CMP0030 OLD)
use_mangled_mesa()
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\)
......@@ -2,6 +2,7 @@ include(RunCMake)
foreach(p
CMP0029
CMP0030
)
run_cmake(${p}-WARN)
run_cmake(${p}-OLD)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment