Skip to content

Commit

Permalink
[cmake] Only apply mgis patch when CPM_SOURCE_CACHE is defined.
Browse files Browse the repository at this point in the history
See cpm-cmake/CPM.cmake#577.

Should fix issues observed by various developers.
  • Loading branch information
bilke committed Sep 10, 2024
1 parent aba2740 commit 3331e89
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scripts/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,22 @@ if(OGS_USE_MFRONT)
find_package(MFrontGenericInterface REQUIRED)
else()
set(CMAKE_REQUIRE_FIND_PACKAGE_TFEL TRUE)
# Patch only works when CPM_SOURCE_CACHE is set. Following conditional
# logic can be removed if
# https://github.com/cpm-cmake/CPM.cmake/issues/577 is resolved.
if(NOT "${CPM_SOURCE_CACHE}" STREQUAL "")
set(_mgis_patch_args
PATCHES ${PROJECT_SOURCE_DIR}/scripts/cmake/mgis-flags.patch
)
message(STATUS "Adding mgis-flags.patch.")
endif()
CPMAddPackage(
NAME MGIS
GITHUB_REPOSITORY thelfer/MFrontGenericInterfaceSupport
GIT_TAG rliv-2.0
OPTIONS "enable-doxygen-doc OFF" "enable-fortran-bindings OFF"
"enable-website OFF"
EXCLUDE_FROM_ALL
YES SYSTEM TRUE PATCHES
${PROJECT_SOURCE_DIR}/scripts/cmake/mgis-flags.patch
EXCLUDE_FROM_ALL YES SYSTEM TRUE ${_mgis_patch_args}
)
list(APPEND DISABLE_WARNINGS_TARGETS MFrontGenericInterface)
endif()
Expand Down

0 comments on commit 3331e89

Please sign in to comment.