aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMCheckOutboundLicense.cmake
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2021-04-17 11:02:00 +0200
committerFriedrich W. H. Kossebau <kossebau@kde.org>2021-04-23 17:49:14 +0000
commit5512e03562694ebfe571a3b6068a7d35d9ddfd7a (patch)
tree3caca041d3526c8427ec3065642b41a52ad8578c /modules/ECMCheckOutboundLicense.cmake
parent38b5d046c4d42232d45bf4464167b2e6feea4cf7 (diff)
downloadextra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.gz
extra-cmake-modules-5512e03562694ebfe571a3b6068a7d35d9ddfd7a.tar.bz2
Modules docs: move rst docs into bracket comments
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
Diffstat (limited to 'modules/ECMCheckOutboundLicense.cmake')
-rw-r--r--modules/ECMCheckOutboundLicense.cmake129
1 files changed, 65 insertions, 64 deletions
diff --git a/modules/ECMCheckOutboundLicense.cmake b/modules/ECMCheckOutboundLicense.cmake
index c49a190d..62a6d1e2 100644
--- a/modules/ECMCheckOutboundLicense.cmake
+++ b/modules/ECMCheckOutboundLicense.cmake
@@ -1,70 +1,71 @@
-#.rst:
-# ECMCheckOutboundLicense
-# -----------------------
-#
-# Assert that source file licenses are compatible with a desired outbound license
-# of a compiled binary artifact (e.g., library, plugin or application).
-#
-# This module provides the ``ecm_check_outbound_license`` function that
-# generates unit tests for checking the compatibility of license statements.
-# The license statements in all tested files are required to be added by using
-# the SPDX marker ``SPDX-License-Identifier``.
-#
-# During the CMake configuration of the project, a temporary license bill of
-# materials (BOM) in SPDX format is generated by calling the REUSE tool
-# (see <https://reuse.software>). That BOM is parsed and license computations
-# based on an internal compatibility matrix are performed.
-#
-# Preconditions for using this module:
-# * All tested input source files must contain the SPDX-License-Identifier tag.
-# * Python3 must be available.
-# * The REUSE tool must be available, which generates the bill-of-materials
-# by running ``reuse spdx`` on the tested directory.
-#
-# When this module is included, a ``SKIP_LICENSE_TESTS`` option is added (default
-# OFF). Turning this option on skips the generation of license tests, which might
-# be convenient if licenses shall not be tested in all build configurations.
-#
-# ::
-#
-# ecm_check_outbound_license(LICENSES <outbound-licenses>
-# FILES <source-files>
-# [TEST_NAME <name>]
-# [WILL_FAIL])
-#
-# This method adds a custom unit test to ensure the specified outbound license to be
-# compatible with the specified license headers. Note that a convenient way is to use
-# the CMake GLOB command of the FILE function.
-#
-# ``LICENSES`` : List of one or multiple outbound license regarding which the compatibility
-# of the source code files shall be tested. Currently, the following values
-# are supported (values are SPDX registry identifiers):
-# * MIT
-# * BSD-2-Clause
-# * BSD-3-Clause
-# * LGPL-2.0-only
-# * LGPL-2.1-only
-# * LGPL-3.0-only
-# * GPL-2.0-only
-# * GPL-3.0-only
-#
-# ``FILES:`` : List of source files that contain valid SPDX-License-Identifier markers.
-# The paths can be relative to the CMake file that generates the test case
-# or be absolute paths.
-#
-# ``TEST_NAME`` : Optional parameter that defines the name of the generated test case.
-# If no name is defined, the relative path to the test directory with appended
-# license name is used. Every test has ``licensecheck_`` as prefix.
-#
-# ``WILL_FAIL`` : Optional parameter that inverts the test result. This parameter is usually only
-# used for tests of the module.
-#
-# Since 5.75.0
-
-#=============================================================================
# SPDX-FileCopyrightText: 2020 Andreas Cord-Landwehr <cordlandwehr@kde.org>
+#
# SPDX-License-Identifier: BSD-3-Clause
+#[=======================================================================[.rst:
+ECMCheckOutboundLicense
+-----------------------
+
+Assert that source file licenses are compatible with a desired outbound license
+of a compiled binary artifact (e.g., library, plugin or application).
+
+This module provides the ``ecm_check_outbound_license`` function that
+generates unit tests for checking the compatibility of license statements.
+The license statements in all tested files are required to be added by using
+the SPDX marker ``SPDX-License-Identifier``.
+
+During the CMake configuration of the project, a temporary license bill of
+materials (BOM) in SPDX format is generated by calling the REUSE tool
+(see <https://reuse.software>). That BOM is parsed and license computations
+based on an internal compatibility matrix are performed.
+
+Preconditions for using this module:
+ * All tested input source files must contain the SPDX-License-Identifier tag.
+ * Python3 must be available.
+ * The REUSE tool must be available, which generates the bill-of-materials
+ by running ``reuse spdx`` on the tested directory.
+
+When this module is included, a ``SKIP_LICENSE_TESTS`` option is added (default
+OFF). Turning this option on skips the generation of license tests, which might
+be convenient if licenses shall not be tested in all build configurations.
+
+::
+
+ ecm_check_outbound_license(LICENSES <outbound-licenses>
+ FILES <source-files>
+ [TEST_NAME <name>]
+ [WILL_FAIL])
+
+This method adds a custom unit test to ensure the specified outbound license to be
+compatible with the specified license headers. Note that a convenient way is to use
+the CMake GLOB command of the FILE function.
+
+``LICENSES`` : List of one or multiple outbound license regarding which the compatibility
+ of the source code files shall be tested. Currently, the following values
+ are supported (values are SPDX registry identifiers):
+ * MIT
+ * BSD-2-Clause
+ * BSD-3-Clause
+ * LGPL-2.0-only
+ * LGPL-2.1-only
+ * LGPL-3.0-only
+ * GPL-2.0-only
+ * GPL-3.0-only
+
+``FILES:`` : List of source files that contain valid SPDX-License-Identifier markers.
+ The paths can be relative to the CMake file that generates the test case
+ or be absolute paths.
+
+``TEST_NAME`` : Optional parameter that defines the name of the generated test case.
+ If no name is defined, the relative path to the test directory with appended
+ license name is used. Every test has ``licensecheck_`` as prefix.
+
+``WILL_FAIL`` : Optional parameter that inverts the test result. This parameter is usually only
+ used for tests of the module.
+
+Since 5.75.0
+#]=======================================================================]
+
include(FeatureSummary)
option(SKIP_LICENSE_TESTS "Skip outbound license tests" OFF)