Skip to content
Snippets Groups Projects
Commit aaaf2bf7 authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Prefer static zlib library on Windows.

Required CMake 3.24 to be effective. See

https://gitlab.kitware.com/cmake/cmake/-/issues/23140
parent 63173be9
No related branches found
No related tags found
No related merge requests found
......@@ -168,9 +168,9 @@ if(NOT ZLIB_FOUND)
"ExternalProject_Add(): added package ZLIB@${ogs.tested_version.zlib}"
)
if(WIN32)
file(INSTALL ${PROJECT_BINARY_DIR}/_ext/ZLIB/bin/
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# requires CMake 3.24 to be effective:
set(ZLIB_USE_STATIC_LIBS "ON")
set(ZLIB_ROOT ${PROJECT_BINARY_DIR}/_ext/ZLIB)
endif()
set(_EXT_LIBS ${_EXT_LIBS} ZLIB CACHE INTERNAL "")
BuildExternalProject_find_package(ZLIB)
......@@ -194,6 +194,9 @@ set(_hdf5_options
)
if("${ZLIB_INCLUDE_DIRS}" MATCHES "${PROJECT_BINARY_DIR}/_ext/ZLIB")
list(APPEND _hdf5_options "-DZLIB_ROOT=${PROJECT_BINARY_DIR}/_ext/ZLIB")
if(WIN32)
list(APPEND _hdf5_options "-DZLIB_USE_STATIC_LIBS=ON")
endif()
endif()
if(OGS_USE_MPI)
set(HDF5_PREFER_PARALLEL ON)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment