From 5512e03562694ebfe571a3b6068a7d35d9ddfd7a Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sat, 17 Apr 2021 11:02:00 +0200 Subject: 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 --- modules/ECMSetupVersion.cmake | 160 +++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 80 deletions(-) (limited to 'modules/ECMSetupVersion.cmake') diff --git a/modules/ECMSetupVersion.cmake b/modules/ECMSetupVersion.cmake index 65c1688a..3164a620 100644 --- a/modules/ECMSetupVersion.cmake +++ b/modules/ECMSetupVersion.cmake @@ -1,88 +1,88 @@ -#.rst: -# ECMSetupVersion -# --------------- -# -# Handle library version information. -# -# :: -# -# ecm_setup_version( -# VARIABLE_PREFIX -# [SOVERSION ] -# [VERSION_HEADER ] -# [PACKAGE_VERSION_FILE [COMPATIBILITY ]] ) -# -# This parses a version string and sets up a standard set of version variables. -# It can optionally also create a C version header file and a CMake package -# version file to install along with the library. -# -# If the ```` argument is of the form ``..`` -# (or ``...``), The following CMake variables are -# set:: -# -# _VERSION_MAJOR - -# _VERSION_MINOR - -# _VERSION_PATCH - -# _VERSION - -# _VERSION_STRING - (for compatibility: use _VERSION instead) -# _SOVERSION - , or if SOVERSION was not given -# -# If CMake policy CMP0048 is not NEW, the following CMake variables will also -# be set:: -# -# PROJECT_VERSION_MAJOR - -# PROJECT_VERSION_MINOR - -# PROJECT_VERSION_PATCH - -# PROJECT_VERSION - -# PROJECT_VERSION_STRING - (for compatibility: use PROJECT_VERSION instead) -# -# If the VERSION_HEADER option is used, a simple C header is generated with the -# given filename. If filename is a relative path, it is interpreted as relative -# to CMAKE_CURRENT_BINARY_DIR. The generated header contains the following -# macros:: -# -# _VERSION_MAJOR - as an integer -# _VERSION_MINOR - as an integer -# _VERSION_PATCH - as an integer -# _VERSION_STRING - as a C string -# _VERSION - the version as an integer -# -# ``_VERSION`` has ```` in the bottom 8 bits, ```` in the -# next 8 bits and ```` in the remaining bits. Note that ```` and -# ```` must be less than 256. -# -# If the PACKAGE_VERSION_FILE option is used, a simple CMake package version -# file is created using the write_basic_package_version_file() macro provided by -# CMake. It should be installed in the same location as the Config.cmake file of -# the library so that it can be found by find_package(). If the filename is a -# relative path, it is interpreted as relative to CMAKE_CURRENT_BINARY_DIR. The -# optional COMPATIBILITY option is forwarded to -# write_basic_package_version_file(), and defaults to AnyNewerVersion. -# -# If CMake policy CMP0048 is NEW, an alternative form of the command is -# available:: -# -# ecm_setup_version(PROJECT -# [VARIABLE_PREFIX ] -# [SOVERSION ] -# [VERSION_HEADER ] -# [PACKAGE_VERSION_FILE ] ) -# -# This will use the version information set by the project() command. -# VARIABLE_PREFIX defaults to the project name. Note that PROJECT must be the -# first argument. In all other respects, it behaves like the other form of the -# command. -# -# Since pre-1.0.0. -# -# COMPATIBILITY option available since 1.6.0. - -#============================================================================= # SPDX-FileCopyrightText: 2014 Alex Merry # SPDX-FileCopyrightText: 2012 Alexander Neundorf # # SPDX-License-Identifier: BSD-3-Clause +#[=======================================================================[.rst: +ECMSetupVersion +--------------- + +Handle library version information. + +:: + + ecm_setup_version( + VARIABLE_PREFIX + [SOVERSION ] + [VERSION_HEADER ] + [PACKAGE_VERSION_FILE [COMPATIBILITY ]] ) + +This parses a version string and sets up a standard set of version variables. +It can optionally also create a C version header file and a CMake package +version file to install along with the library. + +If the ```` argument is of the form ``..`` +(or ``...``), The following CMake variables are +set:: + + _VERSION_MAJOR - + _VERSION_MINOR - + _VERSION_PATCH - + _VERSION - + _VERSION_STRING - (for compatibility: use _VERSION instead) + _SOVERSION - , or if SOVERSION was not given + +If CMake policy CMP0048 is not NEW, the following CMake variables will also +be set:: + + PROJECT_VERSION_MAJOR - + PROJECT_VERSION_MINOR - + PROJECT_VERSION_PATCH - + PROJECT_VERSION - + PROJECT_VERSION_STRING - (for compatibility: use PROJECT_VERSION instead) + +If the VERSION_HEADER option is used, a simple C header is generated with the +given filename. If filename is a relative path, it is interpreted as relative +to CMAKE_CURRENT_BINARY_DIR. The generated header contains the following +macros:: + + _VERSION_MAJOR - as an integer + _VERSION_MINOR - as an integer + _VERSION_PATCH - as an integer + _VERSION_STRING - as a C string + _VERSION - the version as an integer + +``_VERSION`` has ```` in the bottom 8 bits, ```` in the +next 8 bits and ```` in the remaining bits. Note that ```` and +```` must be less than 256. + +If the PACKAGE_VERSION_FILE option is used, a simple CMake package version +file is created using the write_basic_package_version_file() macro provided by +CMake. It should be installed in the same location as the Config.cmake file of +the library so that it can be found by find_package(). If the filename is a +relative path, it is interpreted as relative to CMAKE_CURRENT_BINARY_DIR. The +optional COMPATIBILITY option is forwarded to +write_basic_package_version_file(), and defaults to AnyNewerVersion. + +If CMake policy CMP0048 is NEW, an alternative form of the command is +available:: + + ecm_setup_version(PROJECT + [VARIABLE_PREFIX ] + [SOVERSION ] + [VERSION_HEADER ] + [PACKAGE_VERSION_FILE ] ) + +This will use the version information set by the project() command. +VARIABLE_PREFIX defaults to the project name. Note that PROJECT must be the +first argument. In all other respects, it behaves like the other form of the +command. + +Since pre-1.0.0. + +COMPATIBILITY option available since 1.6.0. +#]=======================================================================] + include(CMakePackageConfigHelpers) # save the location of the header template while CMAKE_CURRENT_LIST_DIR -- cgit v1.2.1