Просмотр исходного кода

Help: move description of CMAKE_PROJECT_* variables

Describe these variables along with the other variables.
Joachim Wuttke (o) 7 лет назад
Родитель
Сommit
2f43bd3b6c
1 измененных файлов с 16 добавлено и 8 удалено
  1. 16 8
      Help/command/project.rst

+ 16 - 8
Help/command/project.rst

@@ -16,7 +16,11 @@ Synopsis
          [LANGUAGES <language-name>...])
          [LANGUAGES <language-name>...])
 
 
 Sets the name of the project, and stores it in the variable
 Sets the name of the project, and stores it in the variable
-:variable:`PROJECT_NAME`.  Also sets the variables
+:variable:`PROJECT_NAME`. When called from the top-level
+``CMakeLists.txt`` also stores the project name in the
+variable :variable:`CMAKE_PROJECT_NAME`.
+
+Also sets the variables
 
 
 * :variable:`PROJECT_SOURCE_DIR`,
 * :variable:`PROJECT_SOURCE_DIR`,
   :variable:`<PROJECT-NAME>_SOURCE_DIR`
   :variable:`<PROJECT-NAME>_SOURCE_DIR`
@@ -55,6 +59,9 @@ The options are:
   * :variable:`PROJECT_VERSION_TWEAK`,
   * :variable:`PROJECT_VERSION_TWEAK`,
     :variable:`<PROJECT-NAME>_VERSION_TWEAK`.
     :variable:`<PROJECT-NAME>_VERSION_TWEAK`.
 
 
+  When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+  then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`.
+
 ``DESCRIPTION <project-description-string>``
 ``DESCRIPTION <project-description-string>``
   Optional.
   Optional.
   Sets the variables
   Sets the variables
@@ -65,6 +72,9 @@ The options are:
   It is recommended that this description is a relatively short string,
   It is recommended that this description is a relatively short string,
   usually no more than a few words.
   usually no more than a few words.
 
 
+  When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+  then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`.
+
 ``HOMEPAGE_URL <url-string>``
 ``HOMEPAGE_URL <url-string>``
   Optional.
   Optional.
   Sets the variables
   Sets the variables
@@ -73,6 +83,9 @@ The options are:
 
 
   to ``<url-string>``, which should be the canonical home URL for the project.
   to ``<url-string>``, which should be the canonical home URL for the project.
 
 
+  When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+  then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`.
+
 ``LANGUAGES <language-name>...``
 ``LANGUAGES <language-name>...``
   Optional.
   Optional.
   Can also be specified without ``LANGUAGES`` keyword per the first, short signature.
   Can also be specified without ``LANGUAGES`` keyword per the first, short signature.
@@ -96,16 +109,11 @@ The top-level ``CMakeLists.txt`` file for a project must contain a
 literal, direct call to the :command:`project` command; loading one
 literal, direct call to the :command:`project` command; loading one
 through the :command:`include` command is not sufficient.  If no such
 through the :command:`include` command is not sufficient.  If no such
 call exists CMake will implicitly add one to the top that enables the
 call exists CMake will implicitly add one to the top that enables the
-default languages (``C`` and ``CXX``).  The name of the project set in
-the top level ``CMakeLists.txt`` file is available from the
-:variable:`CMAKE_PROJECT_NAME` variable, its description from
-:variable:`CMAKE_PROJECT_DESCRIPTION`, its homepage URL from
-:variable:`CMAKE_PROJECT_HOMEPAGE_URL` and its version from
-:variable:`CMAKE_PROJECT_VERSION`.
+default languages (``C`` and ``CXX``).
 
 
 .. note::
 .. note::
   Call the :command:`cmake_minimum_required` command at the beginning
   Call the :command:`cmake_minimum_required` command at the beginning
   of the top-level ``CMakeLists.txt`` file even before calling the
   of the top-level ``CMakeLists.txt`` file even before calling the
-  ``project()`` command.  It is important to establish version and
+  :command:`project()` command.  It is important to establish version and
   policy settings before invoking other commands whose behavior they
   policy settings before invoking other commands whose behavior they
   may affect.  See also policy :policy:`CMP0000`.
   may affect.  See also policy :policy:`CMP0000`.