-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from jchristopherson/v1.4_Development
V1.4 development
- Loading branch information
Showing
188 changed files
with
19,407 additions
and
5,692 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ bin/ | |
build/ | ||
latex/ | ||
lib/ | ||
mod/ | ||
|
||
# CMake Stuff | ||
*.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# helper.cmake | ||
# | ||
# A collection of macros and functions making life with CMake and Fortran a | ||
# bit simpler. | ||
|
||
# Use to include and export headers | ||
function(include_headers lib dir install_dir) | ||
target_include_directories( | ||
${lib} | ||
INTERFACE | ||
$<BUILD_INTERFACE:${dir}> | ||
$<INSTALL_INTERFACE:${install_dir}> | ||
) | ||
endfunction() | ||
|
||
# Use instead of add_library. | ||
function(add_fortran_library lib_name mod_dir include_install_dir version major) | ||
add_library(${lib_name} ${ARGN}) | ||
set_target_properties( | ||
${lib_name} | ||
PROPERTIES | ||
POSITION_INDEPENDENT_CODE TRUE | ||
OUTPUT_NAME ${lib_name} | ||
VERSION ${version} | ||
SOVERSION ${major} | ||
Fortran_MODULE_DIRECTORY ${include_install_dir} | ||
) | ||
target_include_directories( | ||
${lib_name} | ||
PUBLIC | ||
$<BUILD_INTERFACE:${mod_dir}> | ||
$<INSTALL_INTERFACE:${include_install_dir}> | ||
) | ||
endfunction() | ||
|
||
# Installs the library | ||
function(install_library lib_name lib_install_dir bin_install_dir mod_dir install_dir) | ||
install( | ||
TARGETS ${lib_name} | ||
EXPORT ${lib_name}Targets | ||
RUNTIME DESTINATION ${bin_install_dir} | ||
LIBRARY DESTINATION ${lib_install_dir} | ||
ARCHIVE DESTINATION ${lib_install_dir} | ||
INCLUDES DESTINATION ${install_dir}/include | ||
) | ||
install( | ||
DIRECTORY ${mod_dir} | ||
DESTINATION ${install_dir} | ||
) | ||
endfunction() | ||
|
||
# Install the documentation files | ||
function(install_documentation doc_dir install_dir) | ||
install( | ||
DIRECTORY ${doc_dir} | ||
DESTINATION ${install_dir} | ||
) | ||
endfunction() | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Helpful Macros | ||
macro(print_all_variables) | ||
message(STATUS "---------- CURRENTLY DEFIND VARIABLES -----------") | ||
get_cmake_property(varNames VARIABLES) | ||
foreach(varName ${varNames}) | ||
message(STATUS ${varName} = ${${varName}}) | ||
endforeach() | ||
message(STATUS "---------- END ----------") | ||
endmacro() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Get the macros and functions we'll need | ||
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake") | ||
|
||
# Set a default build type if none was specified | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "Setting build type to 'Release' as none was specified.") | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) | ||
# Set the possible values of build type for cmake-gui | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release") | ||
endif() | ||
|
||
# By default, static library | ||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF) | ||
|
||
# Export all symbols on Windows when building libraries | ||
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) | ||
|
||
# Utilize the GNU installation structure | ||
include(GNUInstallDirs) | ||
|
||
# Locate the local include directory | ||
set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include) | ||
set(PROJECT_INCLUDE_DIR ${PROJECT_INCLUDE_DIR} PARENT_SCOPE) | ||
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_INCLUDE_DIR}) |
Oops, something went wrong.