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

Merge branch 'use-zlibstatic-win' into 'master'

[CMake] Prefer static zlib library on Windows.

See merge request ogs/ogs!4209
parents b37fae52 aaaf2bf7
No related branches found
No related tags found
No related merge requests found
...@@ -168,9 +168,9 @@ if(NOT ZLIB_FOUND) ...@@ -168,9 +168,9 @@ if(NOT ZLIB_FOUND)
"ExternalProject_Add(): added package ZLIB@${ogs.tested_version.zlib}" "ExternalProject_Add(): added package ZLIB@${ogs.tested_version.zlib}"
) )
if(WIN32) if(WIN32)
file(INSTALL ${PROJECT_BINARY_DIR}/_ext/ZLIB/bin/ # requires CMake 3.24 to be effective:
DESTINATION ${CMAKE_INSTALL_BINDIR} set(ZLIB_USE_STATIC_LIBS "ON")
) set(ZLIB_ROOT ${PROJECT_BINARY_DIR}/_ext/ZLIB)
endif() endif()
set(_EXT_LIBS ${_EXT_LIBS} ZLIB CACHE INTERNAL "") set(_EXT_LIBS ${_EXT_LIBS} ZLIB CACHE INTERNAL "")
BuildExternalProject_find_package(ZLIB) BuildExternalProject_find_package(ZLIB)
...@@ -194,6 +194,9 @@ set(_hdf5_options ...@@ -194,6 +194,9 @@ set(_hdf5_options
) )
if("${ZLIB_INCLUDE_DIRS}" MATCHES "${PROJECT_BINARY_DIR}/_ext/ZLIB") if("${ZLIB_INCLUDE_DIRS}" MATCHES "${PROJECT_BINARY_DIR}/_ext/ZLIB")
list(APPEND _hdf5_options "-DZLIB_ROOT=${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() endif()
if(OGS_USE_MPI) if(OGS_USE_MPI)
set(HDF5_PREFER_PARALLEL ON) 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