Skip to content

Commit

Permalink
[cmake] metis win fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Oct 25, 2023
1 parent 9263155 commit d1cba44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ parse:
HTTP_PASSWORD: 1
EXCLUDE_FROM_ALL: 1
OPTIONS: +
PATCH_COMMAND: +
cpmfindpackage:
pargs:
nargs: "*"
Expand Down
20 changes: 13 additions & 7 deletions scripts/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -351,31 +351,37 @@ CPMAddPackage(

if(OGS_BUILD_UTILS)
if(NOT GUIX_BUILD)
set(_win_metis_options "MSVC FALSE")
if(WIN32)
set(_win_metis_options "MSVC TRUE")
endif()
CPMFindPackage(
NAME GKlib
GIT_REPOSITORY https://github.com/KarypisLab/GKlib
GIT_TAG 8bd6bad750b2b0d90800c632cf18e8ee93ad72d7
VERSION 5.1.1
OPTIONS "CMAKE_POLICY_DEFAULT_CMP0042 NEW"
OPTIONS "CMAKE_POLICY_DEFAULT_CMP0042 NEW" ${_win_metis_options}
EXCLUDE_FROM_ALL YES
)
CPMFindPackage(
NAME metis
GIT_REPOSITORY https://github.com/KarypisLab/METIS
VERSION 5.2.1
EXCLUDE_FROM_ALL
YES PATCH_COMMAND git apply
${PROJECT_SOURCE_DIR}/scripts/cmake/metis.patch
EXCLUDE_FROM_ALL YES
PATCH_COMMAND git apply
${PROJECT_SOURCE_DIR}/scripts/cmake/metis.patch
OPTIONS ${_win_metis_options}
)
if(GKlib_ADDED AND metis_ADDED)
target_include_directories(
metis PUBLIC ${GKlib_SOURCE_DIR} ${metis_SOURCE_DIR}/include
${metis_SOURCE_DIR}/libmetis
metis SYSTEM
PUBLIC ${GKlib_SOURCE_DIR} ${metis_SOURCE_DIR}/include
${metis_SOURCE_DIR}/libmetis
)
target_compile_definitions(
metis PUBLIC IDXTYPEWIDTH=64 REALTYPEWIDTH=32
)
list(APPEND DISABLE_WARNINGS_TARGETS metis)
list(APPEND DISABLE_WARNINGS_TARGETS metis GKlib)
endif()
else()
find_package(metis REQUIRED)
Expand Down

0 comments on commit d1cba44

Please sign in to comment.