Merge topic 'more-cps-metadata'

755a24ccae CPS: Add export support for [default_]license
fba540daf6 project: Add SPDX_LICENSE argument
f0b419c473 Help: Tweak project DESCRIPTION documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10894
This commit is contained in:
Brad King
2025-06-26 13:05:28 +00:00
committed by Kitware Robot
42 changed files with 277 additions and 44 deletions
+3 -1
View File
@@ -141,7 +141,9 @@ Exporting Targets to the |CPS|
[VERSION_SCHEMA <string>]]
[DEFAULT_TARGETS <target>...]
[DEFAULT_CONFIGURATIONS <config>...]
[DESCRIPTION <project-description-string>]
[LICENSE <license-string>]
[DEFAULT_LICENSE <license-string>]
[DESCRIPTION <description-string>]
[HOMEPAGE_URL <url-string>])
.. versionadded:: 4.1
+28 -2
View File
@@ -1001,7 +1001,9 @@ Signatures
[VERSION_SCHEMA <string>]]
[DEFAULT_TARGETS <target>...]
[DEFAULT_CONFIGURATIONS <config>...]
[DESCRIPTION <project-description-string>]
[LICENSE <license-string>]
[DEFAULT_LICENSE <license-string>]
[DESCRIPTION <description-string>]
[HOMEPAGE_URL <url-string>]
[PERMISSIONS <permission>...]
[CONFIGURATIONS <config>...]
@@ -1059,7 +1061,25 @@ Signatures
configurations exists. If not specified, CMake will fall back to the
package's available configurations in an unspecified order.
``DESCRIPTION <project-description-string>``
``LICENSE <license-string>``
.. versionadded:: 4.2
A |SPDX|_ (SPDX) `License Expression`_ that describes the license(s) of the
project as a whole, including documentation, resources, or other materials
distributed with the project, in addition to software artifacts. See the
SPDX `License List`_ for a list of commonly used licenses and their
identifiers.
The license of individual components is taken from the
:prop_tgt:`SPDX_LICENSE` property of their respective targets.
``DEFAULT_LICENSE <license-string>``
.. versionadded:: 4.2
A |SPDX|_ (SPDX) `License Expression`_ that describes the license(s) of any
components which do not otherwise specify their license(s).
``DESCRIPTION <description-string>``
.. versionadded:: 4.1
An informational description of the project. It is recommended that this
@@ -1291,3 +1311,9 @@ and by CPack. You can also invoke this script manually with
.. _cps-version_schema: https://cps-org.github.io/cps/schema.html#version-schema
.. |cps-version_schema| replace:: ``version_schema``
.. _SPDX: https://spdx.dev/
.. |SPDX| replace:: System Package Data Exchange
.. _License Expression: https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/
.. _License List: https://spdx.org/licenses/
+32 -7
View File
@@ -12,7 +12,8 @@ Synopsis
project(<PROJECT-NAME>
[VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
[COMPAT_VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
[DESCRIPTION <project-description-string>]
[SPDX_LICENSE <license-string>]
[DESCRIPTION <description-string>]
[HOMEPAGE_URL <url-string>]
[LANGUAGES <language-name>...])
@@ -106,7 +107,30 @@ The options are:
``CMakeLists.txt``, then the compatibility version is also stored in the
variable :variable:`CMAKE_PROJECT_COMPAT_VERSION`.
``DESCRIPTION <project-description-string>``
``SPDX_LICENSE <license-string>``
.. versionadded:: 4.2
Optional.
Sets the variables
* :variable:`PROJECT_SPDX_LICENSE`,
:variable:`<PROJECT-NAME>_SPDX_LICENSE`
to ``<license-string>``, which shall be a |SPDX|_ (SPDX)
`License Expression`_ that describes the license(s) of the project as a
whole, including documentation, resources, or other materials distributed
with the project, in addition to software artifacts. See the SPDX
`License List`_ for a list of commonly used licenses and their identifiers.
See the :prop_tgt:`SPDX_LICENSE` property for specifying the license(s) on
individual software artifacts.
.. _SPDX: https://spdx.dev/
.. |SPDX| replace:: System Package Data Exchange
.. _License Expression: https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/
.. _License List: https://spdx.org/licenses/
``DESCRIPTION <description-string>``
.. versionadded:: 3.9
Optional.
@@ -114,7 +138,7 @@ The options are:
* :variable:`PROJECT_DESCRIPTION`, :variable:`<PROJECT-NAME>_DESCRIPTION`
to ``<project-description-string>``.
to ``<description-string>``.
It is recommended that this description is a relatively short string,
usually no more than a few words.
@@ -149,10 +173,11 @@ By default ``C`` and ``CXX`` are enabled if no language options are given.
Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
to skip enabling any languages.
The variables set through the ``VERSION``, ``COMPAT_VERSION``, ``DESCRIPTION``
and ``HOMEPAGE_URL`` options are intended for use as default values in package
metadata and documentation. The :command:`export` and :command:`install`
commands use these accordingly when generating |CPS| package descriptions.
The variables set through the ``VERSION``, ``COMPAT_VERSION``,
``SPDX_LICENSE``, ``DESCRIPTION`` and ``HOMEPAGE_URL`` options are
intended for use as default values in package metadata and documentation.
The :command:`export` and :command:`install` commands use these accordingly
when generating |CPS| package descriptions.
.. |CPS| replace:: Common Package Specification
+6 -3
View File
@@ -98,15 +98,16 @@ Variables that Provide Information
/variable/CMAKE_OBJDUMP
/variable/CMAKE_PARENT_LIST_FILE
/variable/CMAKE_PATCH_VERSION
/variable/CMAKE_PROJECT_COMPAT_VERSION
/variable/CMAKE_PROJECT_DESCRIPTION
/variable/CMAKE_PROJECT_HOMEPAGE_URL
/variable/CMAKE_PROJECT_NAME
/variable/CMAKE_PROJECT_SPDX_LICENSE
/variable/CMAKE_PROJECT_VERSION
/variable/CMAKE_PROJECT_VERSION_MAJOR
/variable/CMAKE_PROJECT_VERSION_MINOR
/variable/CMAKE_PROJECT_VERSION_PATCH
/variable/CMAKE_PROJECT_VERSION_TWEAK
/variable/CMAKE_PROJECT_COMPAT_VERSION
/variable/CMAKE_RANLIB
/variable/CMAKE_ROOT
/variable/CMAKE_RULE_MESSAGES
@@ -154,28 +155,30 @@ Variables that Provide Information
/variable/CMAKE_XCODE_BUILD_SYSTEM
/variable/CMAKE_XCODE_PLATFORM_TOOLSET
/variable/PROJECT-NAME_BINARY_DIR
/variable/PROJECT-NAME_COMPAT_VERSION
/variable/PROJECT-NAME_DESCRIPTION
/variable/PROJECT-NAME_HOMEPAGE_URL
/variable/PROJECT-NAME_IS_TOP_LEVEL
/variable/PROJECT-NAME_SOURCE_DIR
/variable/PROJECT-NAME_SPDX_LICENSE
/variable/PROJECT-NAME_VERSION
/variable/PROJECT-NAME_VERSION_MAJOR
/variable/PROJECT-NAME_VERSION_MINOR
/variable/PROJECT-NAME_VERSION_PATCH
/variable/PROJECT-NAME_VERSION_TWEAK
/variable/PROJECT-NAME_COMPAT_VERSION
/variable/PROJECT_BINARY_DIR
/variable/PROJECT_COMPAT_VERSION
/variable/PROJECT_DESCRIPTION
/variable/PROJECT_HOMEPAGE_URL
/variable/PROJECT_IS_TOP_LEVEL
/variable/PROJECT_NAME
/variable/PROJECT_SOURCE_DIR
/variable/PROJECT_SPDX_LICENSE
/variable/PROJECT_VERSION
/variable/PROJECT_VERSION_MAJOR
/variable/PROJECT_VERSION_MINOR
/variable/PROJECT_VERSION_PATCH
/variable/PROJECT_VERSION_TWEAK
/variable/PROJECT_COMPAT_VERSION
Variables that Change Behavior
==============================
+3 -3
View File
@@ -3,9 +3,9 @@ SPDX_LICENSE
.. versionadded:: 4.1
Specify the license of a target using a |SPDX|_ (SPDX) `License Expression`_.
See the SPDX `License List`_ for a list of commonly used licenses and their
identifiers.
Specify the license(s) of a target using a |SPDX|_ (SPDX)
`License Expression`_. See the SPDX `License List`_ for a list of commonly used
licenses and their identifiers.
.. _SPDX: https://spdx.dev/
.. |SPDX| replace:: System Package Data Exchange
@@ -0,0 +1,41 @@
CMAKE_PROJECT_SPDX_LICENSE
--------------------------
.. versionadded:: 4.2
.. note::
Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
The license(s) of the top level project.
This variable holds the license expression of the project as specified in the
top level CMakeLists.txt file by a :command:`project` command. In the event
that the top level CMakeLists.txt contains multiple :command:`project` calls,
the most recently called one from that top level CMakeLists.txt will determine
the value that ``CMAKE_PROJECT_SPDX_LICENSE`` contains. For example, consider
the following top level CMakeLists.txt:
.. code-block:: cmake
cmake_minimum_required(VERSION 4.2)
project(First SPDX_LICENSE "BSD-3-Clause")
project(Second SPDX_LICENSE "BSD-3-Clause AND CC-BY-SA-4.0")
add_subdirectory(sub)
project(Third SPDX_LICENSE "BSD-3-Clause AND CC0-1.0")
And ``sub/CMakeLists.txt`` with the following contents:
.. code-block:: cmake
project(SubProj SPDX_LICENSE Apache-2.0)
message("CMAKE_PROJECT_SPDX_LICENSE = ${CMAKE_PROJECT_SPDX_LICENSE}")
The most recently seen :command:`project` command from the top level
CMakeLists.txt would be ``project(Second ...)``, so this will print::
CMAKE_PROJECT_SPDX_LICENSE = BSD-3-Clause AND CC-BY-SA-4.0
To obtain the version from the most recent call to :command:`project` in
the current directory scope or above, see the :variable:`PROJECT_SPDX_LICENSE`
variable.
@@ -0,0 +1,11 @@
<PROJECT-NAME>_SPDX_LICENSE
---------------------------
.. versionadded:: 4.2
.. note::
Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
Value given to the ``SPDX_LICENSE`` option of the most recent call to the
:command:`project` command with project name ``<PROJECT-NAME>``, if any.
+12
View File
@@ -0,0 +1,12 @@
PROJECT_SPDX_LICENSE
--------------------
.. versionadded:: 4.2
.. note::
Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
Value given to the ``SPDX_LICENSE`` option of the most recent call to the
:command:`project` command, if any. To obtain the compatibility version of the
top level project, see the :variable:`CMAKE_PROJECT_SPDX_LICENSE` variable.