From 445f2ab1848519bcb42d6784fc02441df6fd4056 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Sat, 20 Jun 2015 12:52:39 +0200 Subject: [PATCH] extend module documentation --- modules/build_info.cmake | 6 ++- modules/code_coverage.cmake | 17 +++++++ modules/default_build_paths.cmake | 15 ++++++ modules/int64.cmake | 15 ++++++ modules/math_libs.cmake | 77 +++++++++++++++++++------------ modules/version.cmake | 2 +- 6 files changed, 99 insertions(+), 33 deletions(-) diff --git a/modules/build_info.cmake b/modules/build_info.cmake index fdfe2b0..41f4ff0 100644 --- a/modules/build_info.cmake +++ b/modules/build_info.cmake @@ -1,5 +1,7 @@ -# Copyright (c) 2015 by Radovan Bast and Jonas Juselius -# see https://github.com/scisoft/autocmake/blob/master/LICENSE +#.rst: +# +# Generates source code that echoes configuration and build +# information to the program output. # generated cmake files will be written to this path # only build info is generated diff --git a/modules/code_coverage.cmake b/modules/code_coverage.cmake index 68e71fc..48f0ac6 100644 --- a/modules/code_coverage.cmake +++ b/modules/code_coverage.cmake @@ -1,3 +1,20 @@ +#.rst: +# +# Enables code coverage by appending corresponding compiler flags. +# +# Variables modified (provided the corresponding language is enabled):: +# +# CMAKE_Fortran_FLAGS +# CMAKE_C_FLAGS +# CMAKE_CXX_FLAGS +# +# Example autocmake.cfg entry:: +# +# [coverage] +# source: https://github.com/scisoft/autocmake/raw/master/modules/code_coverage.cmake +# docopt: --coverage Enable code coverage [default: False]. +# define: '-DENABLE_CODE_COVERAGE=%s' % arguments['--coverage'] + option(ENABLE_CODE_COVERAGE "Enable code coverage" OFF) if(ENABLE_CODE_COVERAGE) diff --git a/modules/default_build_paths.cmake b/modules/default_build_paths.cmake index 0b036e0..ec18966 100644 --- a/modules/default_build_paths.cmake +++ b/modules/default_build_paths.cmake @@ -1,2 +1,17 @@ +#.rst: +# +# Sets binary and library output directories to ${PROJECT_BINARY_DIR}/bin +# and ${PROJECT_BINARY_DIR}/lib, respectively. +# +# Variables modified:: +# +# CMAKE_RUNTIME_OUTPUT_DIRECTORY +# CMAKE_LIBRARY_OUTPUT_DIRECTORY +# +# Example autocmake.cfg entry:: +# +# [default_build_paths] +# source: https://github.com/scisoft/autocmake/raw/master/modules/default_build_paths.cmake + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) diff --git a/modules/int64.cmake b/modules/int64.cmake index 4e58ed9..b82605a 100644 --- a/modules/int64.cmake +++ b/modules/int64.cmake @@ -1,3 +1,18 @@ +#.rst: +# +# Enables 64-bit integer support for Fortran projects. +# +# Variables modified (provided the corresponding language is enabled):: +# +# CMAKE_Fortran_FLAGS +# +# Example autocmake.cfg entry:: +# +# [int64] +# source: https://github.com/scisoft/autocmake/raw/master/modules/int64.cmake +# docopt: --int64 Enable 64bit integers [default: False]. +# define: '-DENABLE_64BIT_INTEGERS=%s' % arguments['--int64'] + option(ENABLE_64BIT_INTEGERS "Enable 64-bit integers" OFF) if(ENABLE_64BIT_INTEGERS) diff --git a/modules/math_libs.cmake b/modules/math_libs.cmake index 78cbcb7..ac80156 100644 --- a/modules/math_libs.cmake +++ b/modules/math_libs.cmake @@ -1,33 +1,50 @@ - -# Copyright (c) 2015 by Radovan Bast and Jonas Juselius -# see https://github.com/scisoft/autocmake/blob/master/LICENSE - -# CMake variables used: -# - MATH_LIB_SEARCH_ORDER, example: set(MATH_LIB_SEARCH_ORDER MKL ESSL ATLAS ACML SYSTEM_NATIVE) -# - ENABLE_BLAS -# - ENABLE_LAPACK -# - BLAS_FOUND -# - LAPACK_FOUND -# - BLAS_LANG -# - LAPACK_LANG -# - BLAS_TYPE -# - LAPACK_TYPE -# - ENABLE_64BIT_INTEGERS -# - CMAKE_HOST_SYSTEM_PROCESSOR -# - BLACS_IMPLEMENTATION -# - MKL_FLAG - -# Environment variables used: -# - MATH_ROOT -# - BLAS_ROOT -# - LAPACK_ROOT -# - MKL_ROOT -# - MKLROOT - -# CMake variables set: -# - MATH_LIBS -# - BLAS_FOUND -# - LAPACK_FOUND +#.rst: +# +# Detects and links to BLAS and LAPACK libraries. +# +# Variables used:: +# +# MATH_LIB_SEARCH_ORDER, example: set(MATH_LIB_SEARCH_ORDER MKL ESSL ATLAS ACML SYSTEM_NATIVE) +# ENABLE_BLAS +# ENABLE_LAPACK +# BLAS_FOUND +# LAPACK_FOUND +# BLAS_LANG +# LAPACK_LANG +# BLAS_TYPE +# LAPACK_TYPE +# ENABLE_64BIT_INTEGERS +# CMAKE_HOST_SYSTEM_PROCESSOR +# BLACS_IMPLEMENTATION +# MKL_FLAG +# +# Variables set:: +# +# MATH_LIBS +# BLAS_FOUND +# LAPACK_FOUND +# +# Environment variables used:: +# +# MATH_ROOT +# BLAS_ROOT +# LAPACK_ROOT +# MKL_ROOT +# MKLROOT +# +# Example autocmake.cfg entry:: +# +# [math_libs] +# source: https://github.com/scisoft/autocmake/raw/master/modules/math_libs.cmake +# docopt: --blas= Detect and link BLAS library (auto or off) [default: auto]. +# --lapack= Detect and link LAPACK library (auto or off) [default: auto]. +# --mkl= Pass MKL flag to the Intel compiler and linker and skip BLAS/LAPACK detection (sequential, parallel, cluster, or off) [default: off]. +# define: '-DENABLE_BLAS=%s' % arguments['--blas'] +# '-DENABLE_LAPACK=%s' % arguments['--lapack'] +# '-DMKL_FLAG=%s' % arguments['--mkl'] +# '-DMATH_LIB_SEARCH_ORDER="MKL;ESSL;ATLAS;ACML;SYSTEM_NATIVE"' +# '-DBLAS_LANG=Fortran' +# '-DLAPACK_LANG=Fortran' #------------------------------------------------------------------------------- # SYSTEM_NATIVE diff --git a/modules/version.cmake b/modules/version.cmake index a1bae57..518cfab 100644 --- a/modules/version.cmake +++ b/modules/version.cmake @@ -4,7 +4,7 @@ # The reason why this information is stored # in a file and not as CMake variable is that CMake-unaware programs can parse # and use it (e.g. Sphinx). Also web-based hosting frontends such as GitLab -# automatically use a file "VERSION". +# automatically use the file "VERSION" if present. # # Variables defined:: #