From 60ecbdfec1390ea5dcc9dd61b010df40fb143492 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Thu, 4 Jun 2015 17:27:18 +0200 Subject: [PATCH] more doc --- .gitignore | 3 +++ modules/fc.cmake | 15 +++++++++++++++ modules/version.cmake | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index ed57d16..65c7d4d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ test/*/cmake/update.py* test/*/cmake/lib/ test/*/cmake/modules/ test/*/setup.py + +# generated by doc/extract_rst.py +doc/module-reference.rst diff --git a/modules/fc.cmake b/modules/fc.cmake index 422e601..70c20e0 100644 --- a/modules/fc.cmake +++ b/modules/fc.cmake @@ -1,3 +1,14 @@ +#.rst: +# +# Adds Fortran support. +# Appends EXTRA_Fortran_FLAGS to CMAKE_Fortran_FLAGS. +# If environment variable FCFLAGS is set, then these flags are used +# and no other flags are appended. +# +# Defines:: +# +# CMAKE_Fortran_MODULE_DIRECTORY (${PROJECT_BINARY_DIR}/include/fortran) + enable_language(Fortran) set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include/fortran) @@ -13,3 +24,7 @@ endif() if(DEFINED EXTRA_Fortran_FLAGS) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${EXTRA_Fortran_FLAGS}") endif() + +if(DEFINED ENV{FCFLAGS}) + set(CMAKE_Fortran_FLAGS "$ENV{FCFLAGS}") +endif() diff --git a/modules/version.cmake b/modules/version.cmake index b4015cf..1255fd1 100644 --- a/modules/version.cmake +++ b/modules/version.cmake @@ -4,6 +4,10 @@ # 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). +# +# Defines:: +# +# PROGRAM_VERSION if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION") file(READ "${PROJECT_SOURCE_DIR}/VERSION" PROGRAM_VERSION)