Commit 3e2a7b93 authored by Robert Schweppe's avatar Robert Schweppe
Browse files

Merge remote-tracking branch 'remotes/origin/develop' into new_release

parents 3373548a dfe3f8d6
Pipeline #20957 failed with stages
in 38 minutes and 58 seconds
......@@ -211,7 +211,7 @@ build-nag62-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.nagfor62
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -219,7 +219,7 @@ build-gfortran64MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran64MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -227,7 +227,7 @@ build-gfortran73MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -235,7 +235,7 @@ build-gfortran83-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -243,7 +243,7 @@ build-gfortran83MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -251,7 +251,7 @@ build-gfortran102-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran102
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -259,7 +259,7 @@ build-gfortran102MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran102MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -267,7 +267,7 @@ build-intel18-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel18
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -275,7 +275,7 @@ build-intel19-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -283,7 +283,7 @@ build-intel19MPI-debug:
variables:
<<: *debug_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -292,7 +292,7 @@ build-nag62-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.nagfor62
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -300,7 +300,7 @@ build-gfortran64MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran64MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -308,7 +308,7 @@ build-gfortran73MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -316,7 +316,7 @@ build-gfortran83-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -324,7 +324,7 @@ build-gfortran83MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -332,7 +332,7 @@ build-gfortran102-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran102
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -340,7 +340,7 @@ build-gfortran102MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran102MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran102MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -348,7 +348,7 @@ build-intel18-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel18
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -356,7 +356,7 @@ build-intel19-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -364,7 +364,7 @@ build-intel19MPI-release:
variables:
<<: *release_vars
<<: *no_test_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF'
<<: *build_template
......@@ -376,7 +376,7 @@ valgrind-gfortran64MPI-debug:
- job: build-gfortran64MPI-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran64MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran64MPI
<<: *valgrind_template
valgrind-gfortran73MPI-debug:
......@@ -384,7 +384,7 @@ valgrind-gfortran73MPI-debug:
- job: build-gfortran73MPI-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
<<: *valgrind_template
valgrind-gfortran83-debug:
......@@ -392,7 +392,7 @@ valgrind-gfortran83-debug:
- job: build-gfortran83-debug
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
<<: *valgrind_template
### # Valgrind not available for Intel and NAG
......@@ -402,7 +402,7 @@ valgrind-gfortran83-debug:
# artifacts: true
# variables:
# <<: *debug_vars
# MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19
# MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
# <<: *valgrind_template
#
# valgrind-nag62-debug:
......@@ -411,7 +411,7 @@ valgrind-gfortran83-debug:
# artifacts: true
# variables:
# <<: *debug_vars
# MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.nagfor62
# MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
# <<: *valgrind_template
#################
......@@ -424,7 +424,7 @@ test-nag62-debug:
artifacts: false
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.nagfor62
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Debug'
<<: *test_template
......@@ -434,7 +434,7 @@ test-nag62-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.nagfor62
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.nagfor62
CMAKE_FLAGS: '-DCMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX=64 -DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -444,7 +444,7 @@ test-gfortran83MPI-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -454,7 +454,7 @@ test-gfortran73MPI-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -464,7 +464,7 @@ test-gfortran73MPI-debug:
artifacts: false
variables:
<<: *debug_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug'
<<: *test_template
......@@ -474,7 +474,7 @@ test-gfortran83-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran83
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran83
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -484,7 +484,7 @@ test-intel18-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel18
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel18
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -494,7 +494,7 @@ test-intel19-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -504,7 +504,7 @@ test-intel19MPI-release:
artifacts: false
variables:
<<: *release_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.intel19MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.intel19MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Release'
<<: *test_template
......@@ -518,7 +518,7 @@ coverage-gcc73:
variables:
<<: *debug_vars
<<: *coverage_vars
MODULE_LOAD_SCRIPT: moduleLoadScripts/eve.gfortran73MPI
MODULE_LOAD_SCRIPT: hpc-module-loads/eve.gfortran73MPI
CMAKE_FLAGS: '-DCMAKE_BUILD_TYPE=Debug -DCMAKE_WITH_COVERAGE=ON'
<<: *coverage_template
......@@ -531,7 +531,7 @@ pages:
stage: deploy
dependencies:
- documentation
- coverage-gcc73
# - coverage-gcc73
script:
# create public dir (remove if already present)
- test -d public && rm -rf public
......@@ -539,8 +539,7 @@ pages:
# create the subdir
- mkdir public/latest/
# TODO: activate once we have a decent version on master, too
# - mkdir public/stable/
- ln -sf public/latest public/stable
- mkdir public/stable/
# copy the doxygen generated html page to the public site
- cp html_dev/* public/latest/ -R
# TODO: activate once we have a decent version on master, too
......@@ -549,8 +548,8 @@ pages:
# create an index.html that redirects to the master documentation (in master folder)
- cp doc/html_files/index.html public/
# create the coverage site
- mkdir -p public/coverage
- cp build_debug/MPR_coverage_CI/* public/coverage -R
- \[ -d build_debug/MPR_coverage_CI \] && mkdir -p public/coverage && cp build_debug/MPR_coverage_CI/* public/coverage -R
- echo "success!"
artifacts:
name: "$CI_COMMIT_REF_NAME"
paths:
......
cmake_minimum_required(VERSION 3.14)
# check version file
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules)
# get version and date from files (version.txt and version_date.txt)
include(version)
get_version(MPR_VER MPR_VER_DEV MPR_DATE)
......@@ -45,17 +45,6 @@ set(EXECUTABLE_NAME "${CMAKE_PROJECT_NAME}_runner")
add_executable(${EXECUTABLE_NAME} ./src/main.f90)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC mpr)
# ifort and gfortran need the flag -cpp to interpret definitions like -DMRM2MHM
# the nag compiler is not able to interpret the flag -cpp but can interpret these definitions anyway
# so we check whether the compiler is able to use the flag -cpp
# for that we need the module CheckFortranCompilerFlag
include(CheckFortranCompilerFlag)
CHECK_Fortran_COMPILER_FLAG("-cpp" CPP_FLAG)
# if the flag exists, we add it to the compilation flags
if (CPP_FLAG)
target_compile_options(${EXECUTABLE_NAME} PUBLIC "-cpp")
endif()
set_target_properties ( ${EXECUTABLE_NAME}
PROPERTIES
COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}"
......
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://git.ufz.de/chs/cmake-fortran-scripts.git
branch = v1.1
commit = a66fe64ab9b4d0a535c1c462bb5dc4513f7252e9
parent = ccb3109d1f34b240c24780b5ca6d8cbe32432e30
method = merge
cmdver = 0.4.3
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
# Cmake Fortran Scripts
Cmake scripts for Fortran Projects at CHS
## Cmake Modules
Modules under `cmake-modules` provide different functions and macros
to be used in `CMakeLists.txt` files.
### `checkfortranpreprocessor.cmake`
- `get_preproc_flag`: checks for the pre-processor flag of the current compiler (`-fpp` or `-cpp`)
- `cpp_definitions`: adds a compile definition and a corresponding cmake option
Can be included with:
```cmake
include(checkfortranpreprocessor)
```
### `CodeCoverage.cmake`
Taken from: https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake
Can be included and set up with:
```cmake
include(CodeCoverage)
append_coverage_compiler_flags()
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME PROJECT_coverage_CI
EXECUTABLE PROJECT
DEPENDENCIES PROJECT
GENHTML_ARGS -t "PROJECT coverage"
)
```
### `compileoptions.cmake`
Adds cmake compile options
- `CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT`: setting r_path
- `CMAKE_NETCDF_DIR`: separate netcdf path
- `CMAKE_WITH_MPI`: use MPI
- `CMAKE_WITH_OpenMP`: use OpenMP
- `CMAKE_WITH_LAPACK`: use LAPACK bindings
- `CMAKE_WITH_COVERAGE`: Coverage calculation
- will also search for `MPI`, `OpenMP` and `LAPACK` if the option are `ON`
Can be included with:
```cmake
include(compileoptions)
```
### `FindNetCDF.cmake`
Find NetCDF package.
Can be used with:
```cmake
find_package(NetCDF REQUIRED)
```
### `utils.cmake`
Based on: https://github.com/fortran-lang/stdlib/blob/master/cmake/stdlib.cmake
- handles `fypp` pre-processor
Can be included with:
```cmake
include(utils)
```
### `version.cmake`
Provides a function to read version and date from a given files `version.txt` and `version-date.txt`.
Can be included and used with (`PROJECT_VER_DEV` will hold the develop version string):
```cmake
include(version)
get_version(PROJECT_VER PROJECT_VER_DEV PROJECT_DATE)
```
## Cmake Cache Files
Cache files provide templates for specific cmake setups.
Cmake can be controlled with such a file (`exampleFile`) in the following way
```bash
cmake -C exampleFile ..
```
Have a look at the example files in `cmake-cache-files` taken from `mHM`.
#-D CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT=ON
option(CMAKE_BUILD_MODULE_SYSTEM_INDEPENDENT
"build the module INDEPENDENT of the module system, so the build in the build tree works even after a module purge"
ON
)
##-D CMAKE_WITH_MPI=ON
option(CMAKE_WITH_MPI "build the module with MPI, so it can be executed using mpirun" ON)
#option(CMAKE_pgiFortran "Code exchange for pgi compiler dependent issues" ON)
#option(CMAKE_MPR_STANDALONE "If set to ON, only MPR is compiled" ON)
#option(CMAKE_ABSOFT "Documentation to be added. If you you are developer, you might edit this string in CMakeLists.txt" ON)
# set set specific path where to search for the netCDF directory
set(CMAKE_NETCDF_DIR "/path/to/netcdfdir/" CACHE PATH "set set specific place where to search for the netCDF directory")
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#