ENH: Clarify documentation of policy CMP0000 and its relationship with cmake_minimum_required.

This commit is contained in:
Brad King 2008-03-13 17:32:13 -04:00
parent 9a83ce6efc
commit a340fd42b8
2 changed files with 16 additions and 9 deletions

View File

@ -69,11 +69,11 @@ public:
" cmake_minimum_required(VERSION major[.minor[.patch]]\n" " cmake_minimum_required(VERSION major[.minor[.patch]]\n"
" [FATAL_ERROR])\n" " [FATAL_ERROR])\n"
"If the current version of CMake is lower than that required " "If the current version of CMake is lower than that required "
"it will stop processing the project and report an error.\n" "it will stop processing the project and report an error. "
"When a version higher than 2.4 is specified the command implicitly " "When a version higher than 2.4 is specified the command implicitly "
"invokes\n" "invokes\n"
" cmake_policy(VERSION major[.minor[.patch]])\n" " cmake_policy(VERSION major[.minor[.patch]])\n"
"which sets the cmake policy version level to the version specified.\n" "which sets the cmake policy version level to the version specified. "
"When version 2.4 or lower is given the command implicitly invokes\n" "When version 2.4 or lower is given the command implicitly invokes\n"
" cmake_policy(VERSION 2.4)\n" " cmake_policy(VERSION 2.4)\n"
"which enables compatibility features for CMake 2.4 and lower.\n" "which enables compatibility features for CMake 2.4 and lower.\n"

View File

@ -90,15 +90,22 @@ cmPolicies::cmPolicies()
"A policy version number must be specified.", "A policy version number must be specified.",
"CMake requires that projects specify the version of CMake to which " "CMake requires that projects specify the version of CMake to which "
"they have been written. " "they have been written. "
"This policy has been put in place to help CMake maintain backwards " "This policy has been put in place to help existing projects build with "
"compatibility with existing projects while allowing it to evolve " "new CMake versions as it evolves. "
"more rapidly.\n"
"The easiest way to specify a policy version number is to " "The easiest way to specify a policy version number is to "
"call the cmake_policy command at the top of your CMakeLists file:\n" "call the cmake_minimum_required command at the top of "
"your CMakeLists.txt file:\n"
" cmake_minimum_required(VERSION <major>.<minor>)\n"
"where \"<major>.<minor>\" is the version of CMake you want to support "
"(such as \"2.6\"). "
"The command will ensure that at least the given version of CMake is "
"running and set the policy version. "
"See documentation of cmake_minimum_required for details. "
"The cmake_policy command may be used at any time to set the "
"policy version:\n"
" cmake_policy(VERSION <major>.<minor>)\n" " cmake_policy(VERSION <major>.<minor>)\n"
"where <major>.<minor> is the version of CMake you want to support. " "This is the recommended way to set the policy version except at "
"The cmake_minimum_required command may also be used; see its " "the very top of a project.",
"documentation for details.",
2,6,0, cmPolicies::WARN 2,6,0, cmPolicies::WARN
); );