extend module documentation

This commit is contained in:
Radovan Bast 2015-06-20 13:10:00 +02:00
parent 445f2ab184
commit 0c5690a34a
4 changed files with 46 additions and 17 deletions

View File

@ -18,7 +18,7 @@
# BLACS_IMPLEMENTATION # BLACS_IMPLEMENTATION
# MKL_FLAG # MKL_FLAG
# #
# Variables set:: # Variables defined::
# #
# MATH_LIBS # MATH_LIBS
# BLAS_FOUND # BLAS_FOUND

View File

@ -1,19 +1,27 @@
function(guard_against_in_source in_source_dir in_binary_dir) #.rst:
if(${in_source_dir} STREQUAL ${in_binary_dir}) #
message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.") # Provides safeguards against in-source builds and bad build types.
endif() #
endfunction() # Variables used::
#
# PROJECT_SOURCE_DIR
# PROJECT_BINARY_DIR
# CMAKE_BUILD_TYPE
#
# Example autocmake.cfg entry::
#
# [safeguards]
# source: https://github.com/scisoft/autocmake/raw/master/modules/safeguards.cmake
function(guard_against_bad_build_types in_build_type) if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
string(TOLOWER "${in_build_type}" cmake_build_type_tolower) message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there.")
string(TOUPPER "${in_build_type}" cmake_build_type_toupper) endif()
if( NOT cmake_build_type_tolower STREQUAL "debug" string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
AND NOT cmake_build_type_tolower STREQUAL "release" string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)
AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
message(FATAL_ERROR "Unknown build type \"${in_build_type}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).")
endif()
endfunction()
guard_against_in_source(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) if( NOT cmake_build_type_tolower STREQUAL "debug"
guard_against_bad_build_types(${CMAKE_BUILD_TYPE}) AND NOT cmake_build_type_tolower STREQUAL "release"
AND NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).")
endif()

View File

@ -1 +1,5 @@
#.rst:
#
# Adds ${PROJECT_SOURCE_DIR}/src as subdirectory containing CMakeLists.txt.
add_subdirectory(${PROJECT_SOURCE_DIR}/src) add_subdirectory(${PROJECT_SOURCE_DIR}/src)

View File

@ -1,3 +1,20 @@
#.rst:
#
# Enables static linking 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::
#
# [static_linking]
# source: https://github.com/scisoft/autocmake/raw/master/modules/static_linking.cmake
# docopt: --static Enable static linking [default: False].
# define: '-DENABLE_STATIC_LINKING=%s' % arguments['--static']
option(ENABLE_STATIC_LINKING "Enable static libraries linking" OFF) option(ENABLE_STATIC_LINKING "Enable static libraries linking" OFF)
if(ENABLE_STATIC_LINKING) if(ENABLE_STATIC_LINKING)