From c20d22c951e61a06701f6c2201add7c11915e7c5 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Thu, 10 Apr 2014 21:38:09 +0100 Subject: Add documentation generation using Sphinx This is deliberately modelled very closely on CMake's documentation system. It's a hefty patch, because it involved changing all the documentation to be in reStructuredText format. I also cleaned up the copyright/license statements at the same time. Note that the find modules contain the full license, due to the fact that ecm_use_find_module() copies them out of the ECM distribution. --- modules/ECMSetupVersion.cmake | 91 ++++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 35 deletions(-) (limited to 'modules/ECMSetupVersion.cmake') diff --git a/modules/ECMSetupVersion.cmake b/modules/ECMSetupVersion.cmake index 3a8defd8..3ae6fa8f 100644 --- a/modules/ECMSetupVersion.cmake +++ b/modules/ECMSetupVersion.cmake @@ -1,49 +1,70 @@ -# This file provides the function ecm_setup_version(). -# ECM_SETUP_VERSION() bundles three things which are usually done for versioned libraries: -# - it sets a set of version variables -# - optionally it creates a C version header file, which can then be installed along with the library -# - optionally it creates a CMake package version file, which can then be installed along with a -# CMake package Config.cmake file +#.rst: +# ECMSetupVersion +# --------------- +# +# Handle library version information. +# +# :: # # ecm_setup_version( -# VARIABLE_PREFIX prefix +# VARIABLE_PREFIX # [SOVERSION ] -# [VERSION_HEADER filename] -# [PACKAGE_VERSION_FILE filename] ) +# [VERSION_HEADER ] +# [PACKAGE_VERSION_FILE ] ) +# +# 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:: # -# ecm_setup_version() sets the following CMake variables -# _VERSION_MAJOR = -# _VERSION_MINOR = -# _VERSION_PATCH = -# _VERSION_STRING = .. -# _SOVERSION is set to if has not been specified. +# _VERSION_MAJOR - +# _VERSION_MINOR - +# _VERSION_PATCH - +# _VERSION_STRING - +# _SOVERSION - , or if SOVERSION was not given +# PROJECT_VERSION_MAJOR - +# PROJECT_VERSION_MINOR - +# PROJECT_VERSION_PATCH - +# PROJECT_VERSION_STRING - # -# It also sets PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH and -# PROJECT_VERSION_STRING, for easier use with configure_file and file(GENERATE). +# 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:: # -# 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 -# _VERSION_MINOR -# _VERSION_PATCH -# _VERSION_STRING - containing the full version number as a C string -# _VERSION - containing the full version combined into one integer +# _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 coming -# with CMake. It should be installed along the Config.cmake file of the library -# into the same directory where it can be found by find_package(). -# Also here, if the given filename is a relative path, it is interpreted as -# relative to CMAKE_CURRENT_BINARY_DIR. +# 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. -# Copyright (c) 2012, Alexander Neundorf, +#============================================================================= +# Copyright 2012 Alexander Neundorf # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file COPYING-CMAKE-SCRIPTS for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of extra-cmake-modules, substitute the full +# License text for the above reference.) + +# FIXME: Figure out how this should interact with CMP0048 in CMake 3.0.0 include(CMakePackageConfigHelpers) -- cgit v1.2.1