Skip to content

Commit

Permalink
Merge branch 'mgis-patch-fix' into 'master'
Browse files Browse the repository at this point in the history
[cmake] Only apply mgis patch when CPM_SOURCE_CACHE is defined

See merge request ogs/ogs!5098
  • Loading branch information
endJunction committed Sep 11, 2024
2 parents aba2740 + 3331e89 commit 6aaa814
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 6aaa814

Please sign in to comment.