Skip to content

Commit

Permalink
Merge branch 'release_5.12_prepare' into 'develop'
Browse files Browse the repository at this point in the history
Release 5.12

Closes #227 and #231

See merge request mhm/mhm!136
  • Loading branch information
MuellerSeb committed Oct 3, 2022
2 parents 0880dfc + 028a2bf commit 12e5064
Show file tree
Hide file tree
Showing 46 changed files with 989 additions and 911 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ latex
doxygen_warn.txt

# Exclusions
./mhm
mhm
mhm_debug
mhm_mpi
mhm_mpi_debug
mhm_openmp
mhm_openmp_debug
*.g90
*.o
*.mod
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ target_compile_definitions(mhm_lib PRIVATE
# setup coverage with GNU
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND CMAKE_WITH_COVERAGE)
include(cmake/cmake-modules/CodeCoverage.cmake)
target_compile_options(mhm_lib PUBLIC -g --coverage)
target_link_libraries(mhm_lib PUBLIC gcov)
append_coverage_compiler_flags_to_target(mhm_lib)
append_coverage_compiler_flags_to_target(mhm)
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME mhm_coverage_CI
EXECUTABLE ../CI-scripts/run_cmake_coverage.sh
DEPENDENCIES mhm mhm_lib
EXCLUDE src/lib/*
GENHTML_ARGS -t "mHM coverage" --html-prolog ../doc/html_files/cov_header.prolog
)
endif()
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ To cite a certain version, have a look at the [Zenodo site][10].
## Install

mHM can be compiled with cmake. See more details under [cmake manual][9].
Please see the file [DEPENDENCIES][8] for external software required to run mHM.
See also the [documentation][5] for detailed instructions to setup mHM.


Expand All @@ -48,6 +47,5 @@ See also the [documentation][5] for detailed instructions to setup mHM.
[5]: https://mhm.pages.ufz.de/mhm
[6]: LICENSE
[7]: https://mhm-ufz.org/about/publications/
[8]: doc/DEPENDENCIES.md
[9]: doc/INSTALL.md
[10]: https://zenodo.org/record/3239055
6 changes: 3 additions & 3 deletions cmake/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://git.ufz.de/chs/cmake-fortran-scripts.git
branch = v1.7
commit = b4ffa3641b3d1ab733d98500dc2364a91eda15e5
parent = 02d7e12dec8a300b7fa1f0cd2b22d92df9b00fd2
branch = v1.8
commit = cd0fbc5c5dc01cafe054eb421e3287624fb3750b
parent = 775f51f2a607c2fa49f3b8356668ddfd607beb4d
method = merge
cmdver = 0.4.3
4 changes: 2 additions & 2 deletions cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Taken from: https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmak
Can be included and set up with:
```cmake
include(CodeCoverage)
append_coverage_compiler_flags()
append_coverage_compiler_flags_to_target(PROJECT)
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME PROJECT_coverage_CI
EXECUTABLE PROJECT
Expand Down Expand Up @@ -79,7 +79,7 @@ If there is no `version_date.txt` file or a development version was found, the s
`PROJECT_VER` will hold the simple version to be used with cmakes `project` command (e.g. `1.0.0`).
A prefixed `v` in the version will be ignored.

### `CPM.cmake` (v0.35.1)
### `CPM.cmake` (v0.35.6)

CPM.cmake is a CMake script that adds dependency management capabilities to CMake.
It's built as a thin wrapper around CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
Expand Down
58 changes: 44 additions & 14 deletions cmake/cmake-modules/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

set(CURRENT_CPM_VERSION 0.35.1)
set(CURRENT_CPM_VERSION 0.35.6)

get_filename_component(CPM_CURRENT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
if(CPM_DIRECTORY)
if(NOT CPM_DIRECTORY STREQUAL CMAKE_CURRENT_LIST_DIR)
if(NOT CPM_DIRECTORY STREQUAL CPM_CURRENT_DIRECTORY)
if(CPM_VERSION VERSION_LESS CURRENT_CPM_VERSION)
message(
AUTHOR_WARNING
Expand Down Expand Up @@ -66,6 +67,26 @@ endif()

set_property(GLOBAL PROPERTY CPM_INITIALIZED true)

macro(cpm_set_policies)
# the policy allows us to change options without caching
cmake_policy(SET CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

# the policy allows us to change set(CACHE) without caching
if(POLICY CMP0126)
cmake_policy(SET CMP0126 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
endif()

# The policy uses the download time for timestamp, instead of the timestamp in the archive. This
# allows for proper rebuilds when a projects url changes
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
endif()
endmacro()
cpm_set_policies()

option(CPM_USE_LOCAL_PACKAGES "Always try to use `find_package` to get dependencies"
$ENV{CPM_USE_LOCAL_PACKAGES}
)
Expand Down Expand Up @@ -93,7 +114,7 @@ set(CPM_VERSION
CACHE INTERNAL ""
)
set(CPM_DIRECTORY
${CMAKE_CURRENT_LIST_DIR}
${CPM_CURRENT_DIRECTORY}
CACHE INTERNAL ""
)
set(CPM_FILE
Expand Down Expand Up @@ -214,6 +235,9 @@ function(cpm_find_package NAME VERSION)
string(REPLACE " " ";" EXTRA_ARGS "${ARGN}")
find_package(${NAME} ${VERSION} ${EXTRA_ARGS} QUIET)
if(${CPM_ARGS_NAME}_FOUND)
if(DEFINED ${CPM_ARGS_NAME}_VERSION)
set(VERSION ${${CPM_ARGS_NAME}_VERSION})
endif()
message(STATUS "${CPM_INDENT} using local package ${CPM_ARGS_NAME}@${VERSION}")
CPMRegisterPackage(${CPM_ARGS_NAME} "${VERSION}")
set(CPM_PACKAGE_FOUND
Expand Down Expand Up @@ -476,6 +500,8 @@ endfunction()

# Download and add a package from source
function(CPMAddPackage)
cpm_set_policies()

list(LENGTH ARGN argnLength)
if(argnLength EQUAL 1)
cpm_parse_add_package_single_arg("${ARGN}" ARGN)
Expand Down Expand Up @@ -650,6 +676,20 @@ function(CPMAddPackage)
list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS DOWNLOAD_COMMAND ${CPM_ARGS_DOWNLOAD_COMMAND})
elseif(DEFINED CPM_ARGS_SOURCE_DIR)
list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR ${CPM_ARGS_SOURCE_DIR})
if(NOT IS_ABSOLUTE ${CPM_ARGS_SOURCE_DIR})
# Expand `CPM_ARGS_SOURCE_DIR` relative path. This is important because EXISTS doesn't work
# for relative paths.
get_filename_component(
source_directory ${CPM_ARGS_SOURCE_DIR} REALPATH BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}
)
else()
set(source_directory ${CPM_ARGS_SOURCE_DIR})
endif()
if(NOT EXISTS ${source_directory})
string(TOLOWER ${CPM_ARGS_NAME} lower_case_name)
# remove timestamps so CMake will re-download the dependency
file(REMOVE_RECURSE "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild")
endif()
elseif(CPM_SOURCE_CACHE AND NOT CPM_ARGS_NO_CACHE)
string(TOLOWER ${CPM_ARGS_NAME} lower_case_name)
set(origin_parameters ${CPM_ARGS_UNPARSED_ARGUMENTS})
Expand All @@ -672,7 +712,7 @@ function(CPMAddPackage)
)
cpm_get_fetch_properties("${CPM_ARGS_NAME}")

if(DEFINED CPM_ARGS_GIT_TAG)
if(DEFINED CPM_ARGS_GIT_TAG AND NOT (PATCH_COMMAND IN_LIST CPM_ARGS_UNPARSED_ARGUMENTS))
# warn if cache has been changed since checkout
cpm_check_git_working_dir_is_clean(${download_directory} ${CPM_ARGS_GIT_TAG} IS_CLEAN)
if(NOT ${IS_CLEAN})
Expand Down Expand Up @@ -891,16 +931,6 @@ function(
set(addSubdirectoryExtraArgs "")
endif()
if(OPTIONS)
# the policy allows us to change options without caching
cmake_policy(SET CMP0077 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

# the policy allows us to change set(CACHE) without caching
if(POLICY CMP0126)
cmake_policy(SET CMP0126 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
endif()

foreach(OPTION ${OPTIONS})
cpm_parse_option("${OPTION}")
set(${OPTION_KEY} "${OPTION_VALUE}")
Expand Down
Loading

0 comments on commit 12e5064

Please sign in to comment.