summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-30 14:31:53 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-04-30 14:31:53 (GMT)
commit769facf0b6e350aaa5b6f8206dd813d3f9184dfb (patch)
tree44e5bb52faa55cea339142e948a94ae2c2373577
parent0060e159fb7e93a5cb57669746b8aa47892de772 (diff)
parent6ac3712da0f1e90884a27d9c03974260f42d04f7 (diff)
downloadCMake-769facf0b6e350aaa5b6f8206dd813d3f9184dfb.zip
CMake-769facf0b6e350aaa5b6f8206dd813d3f9184dfb.tar.gz
CMake-769facf0b6e350aaa5b6f8206dd813d3f9184dfb.tar.bz2
Merge topic 'doc-cmake_minimum_required-first'
6ac3712d Help: Document that cmake_minimum_required should be called first
-rw-r--r--Help/command/cmake_minimum_required.rst7
-rw-r--r--Help/command/project.rst7
2 files changed, 14 insertions, 0 deletions
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 1bdffa4..92e3001 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -28,3 +28,10 @@ which enables compatibility features for CMake 2.4 and lower.
The FATAL_ERROR option is accepted but ignored by CMake 2.6 and
higher. It should be specified so CMake versions 2.4 and lower fail
with an error instead of just a warning.
+
+.. note::
+ Call the ``cmake_minimum_required()`` command at the beginning of
+ the top-level ``CMakeLists.txt`` file even before calling the
+ :command:`project` command. It is important to establish version
+ and policy settings before invoking other commands whose behavior
+ they may affect. See also policy :policy:`CMP0000`.
diff --git a/Help/command/project.rst b/Help/command/project.rst
index c601a01..6c5ace7 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -55,3 +55,10 @@ literal, direct call to the :command:`project` command; loading one
through the :command:`include` command is not sufficient. If no such
call exists CMake will implicitly add one to the top that enables the
default languages (``C`` and ``CXX``).
+
+.. note::
+ Call the :command:`cmake_minimum_required` command at the beginning
+ of the top-level ``CMakeLists.txt`` file even before calling the
+ ``project()`` command. It is important to establish version and
+ policy settings before invoking other commands whose behavior they
+ may affect. See also policy :policy:`CMP0000`.