cmCMakeMinimumRequired.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCMakeMinimumRequired_h
  11. #define cmCMakeMinimumRequired_h
  12. #include "cmCommand.h"
  13. /** \class cmCMakeMinimumRequired
  14. * \brief Build a CMAKE variable
  15. *
  16. * cmCMakeMinimumRequired sets a variable to a value with expansion.
  17. */
  18. class cmCMakeMinimumRequired : public cmCommand
  19. {
  20. public:
  21. /**
  22. * This is a virtual constructor for the command.
  23. */
  24. virtual cmCommand* Clone()
  25. {
  26. return new cmCMakeMinimumRequired;
  27. }
  28. /**
  29. * This is called when the command is first encountered in
  30. * the CMakeLists.txt file.
  31. */
  32. virtual bool InitialPass(std::vector<std::string> const& args,
  33. cmExecutionStatus &status);
  34. /**
  35. * This determines if the command is invoked when in script mode.
  36. */
  37. virtual bool IsScriptable() { return true; }
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() {return "cmake_minimum_required";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Set the minimum required version of cmake for a project.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " cmake_minimum_required(VERSION major[.minor[.patch]]\n"
  56. " [FATAL_ERROR])\n"
  57. "If the current version of CMake is lower than that required "
  58. "it will stop processing the project and report an error. "
  59. "When a version higher than 2.4 is specified the command implicitly "
  60. "invokes\n"
  61. " cmake_policy(VERSION major[.minor[.patch]])\n"
  62. "which sets the cmake policy version level to the version specified. "
  63. "When version 2.4 or lower is given the command implicitly invokes\n"
  64. " cmake_policy(VERSION 2.4)\n"
  65. "which enables compatibility features for CMake 2.4 and lower.\n"
  66. "The FATAL_ERROR option is accepted but ignored by CMake 2.6 "
  67. "and higher. "
  68. "It should be specified so CMake versions 2.4 and lower fail with an "
  69. "error instead of just a warning.";
  70. }
  71. cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
  72. private:
  73. std::vector<std::string> UnknownArguments;
  74. bool EnforceUnknownArguments();
  75. };
  76. #endif