From fd28c382b44ee355099750419ecd46e0aa175de0 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 16 Mar 2018 07:18:42 +1100 Subject: project: Add _DESCRIPTION For consistency with the VERSION keyword, also define the _DESCRIPTION variable. --- Help/command/project.rst | 7 ++++--- Help/manual/cmake-variables.7.rst | 1 + Help/variable/PROJECT-NAME_DESCRIPTION.rst | 5 +++++ Source/cmProjectCommand.cxx | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 Help/variable/PROJECT-NAME_DESCRIPTION.rst diff --git a/Help/command/project.rst b/Help/command/project.rst index ac71d7a..062e9ea 100644 --- a/Help/command/project.rst +++ b/Help/command/project.rst @@ -41,9 +41,10 @@ in variables Variables corresponding to unspecified versions are set to the empty string (if policy :policy:`CMP0048` is set to ``NEW``). -If optional ``DESCRIPTION`` is given, then additional :variable:`PROJECT_DESCRIPTION` -variable will be set to its argument. The argument must be a string with short -description of the project (only a few words). +If the optional ``DESCRIPTION`` is given, then :variable:`PROJECT_DESCRIPTION` +and :variable:`_DESCRIPTION` will be set to its argument. +The description is expected to be a relatively short string, usually no more +than a few words. Optionally you can specify which languages your project supports. Example languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 13a72df..2bf8c9c 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -97,6 +97,7 @@ Variables that Provide Information /variable/CMAKE_XCODE_GENERATE_SCHEME /variable/CMAKE_XCODE_PLATFORM_TOOLSET /variable/PROJECT-NAME_BINARY_DIR + /variable/PROJECT-NAME_DESCRIPTION /variable/PROJECT-NAME_SOURCE_DIR /variable/PROJECT-NAME_VERSION /variable/PROJECT-NAME_VERSION_MAJOR diff --git a/Help/variable/PROJECT-NAME_DESCRIPTION.rst b/Help/variable/PROJECT-NAME_DESCRIPTION.rst new file mode 100644 index 0000000..2b88b1a --- /dev/null +++ b/Help/variable/PROJECT-NAME_DESCRIPTION.rst @@ -0,0 +1,5 @@ +_DESCRIPTION +-------------------------- + +Value given to the ``DESCRIPTION`` option of the most recent call to the +:command:`project` command with project name ````, if any. diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 67c971f..3470648 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -261,6 +261,8 @@ bool cmProjectCommand::InitialPass(std::vector const& args, if (haveDescription) { this->Makefile->AddDefinition("PROJECT_DESCRIPTION", description.c_str()); + this->Makefile->AddDefinition(projectName + "_DESCRIPTION", + description.c_str()); // Set the CMAKE_PROJECT_DESCRIPTION variable to be the highest-level // project name in the tree. If there are two project commands // in the same CMakeLists.txt file, and it is the top level -- cgit v0.12