Resync (forgot to add new files?)
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmCMakePolicyCommand.h
blob4d43af8cdf38f91ff963ffb937af86ae9b861439
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCMakePolicyCommand.h,v $
5 Language: C++
6 Date: $Date: 2008-03-13 15:38:46 $
7 Version: $Revision: 1.4 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmCMakePolicyCommand_h
18 #define cmCMakePolicyCommand_h
20 #include "cmCommand.h"
22 /** \class cmCMakePolicyCommand
23 * \brief Set how CMake should handle policies
25 * cmCMakePolicyCommand sets how CMake should deal with backwards
26 * compatibility policies.
28 class cmCMakePolicyCommand : public cmCommand
30 public:
31 /**
32 * This is a virtual constructor for the command.
34 virtual cmCommand* Clone()
36 return new cmCMakePolicyCommand;
39 /**
40 * This is called when the command is first encountered in
41 * the CMakeLists.txt file.
43 virtual bool InitialPass(std::vector<std::string> const& args,
44 cmExecutionStatus &status);
46 /**
47 * This determines if the command is invoked when in script mode.
49 virtual bool IsScriptable() { return true; }
51 /**
52 * The name of the command as specified in CMakeList.txt.
54 virtual const char* GetName() {return "cmake_policy";}
56 /**
57 * Succinct documentation.
59 virtual const char* GetTerseDocumentation()
61 return "Manage CMake policy settings.";
64 /**
65 * More documentation.
67 virtual const char* GetFullDocumentation()
69 return
70 " cmake_policy(VERSION major.minor[.patch])\n"
71 "Specify that the current CMake list file is written for the "
72 "given version of CMake. "
73 "All policies introduced in the specified version or earlier "
74 "will be set NEW. "
75 "All policies introduced after the specified version will be set "
76 "to WARN, which is like OLD but also produces a warning. "
77 "This effectively requests behavior preferred as of a given CMake "
78 "version and tells newer CMake versions to warn about their new "
79 "policies. "
80 "The policy version specified must be at least 2.4 or the command "
81 "will report an error. "
82 "In order to get compatibility features supporting versions earlier "
83 "than 2.4 see documentation of policy CMP0001."
84 "\n"
85 " cmake_policy(SET <CMPNNNN> NEW)\n"
86 " cmake_policy(SET <CMPNNNN> OLD)\n"
87 "Tell CMake to use the OLD or NEW behavior for a given policy. "
88 "Projects depending on the old behavior of a given policy may "
89 "silence a policy warning by setting the policy state to OLD. "
90 "Alternatively one may fix the project to work with the new behavior "
91 "and set the policy state to NEW."
92 "\n"
93 " cmake_policy(PUSH)\n"
94 " cmake_policy(POP)\n"
95 "Push and pop the current policy setting state on a stack. "
96 "Each PUSH must have a matching POP. "
97 "This is useful when mixing multiple projects, subprojects, and "
98 "files included from external projects that may each have been "
99 "written for a different version of CMake."
103 cmTypeMacro(cmCMakePolicyCommand, cmCommand);
104 private:
105 bool HandleSetMode(std::vector<std::string> const& args);
106 bool HandleVersionMode(std::vector<std::string> const& args);
111 #endif