Skip to content

Commit 1185866

Browse files
committed
allow system zlib
1 parent 1fe96fc commit 1185866

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmake/build_hdf5.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ set(HDF5_INCLUDE_DIRS ${HDF5_ROOT}/include)
2828
# --- Zlib
2929
set(zlib_root -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON -DZLIB_USE_EXTERNAL:BOOL=OFF)
3030

31-
include(${CMAKE_CURRENT_LIST_DIR}/build_zlib.cmake)
32-
31+
if(TARGET ZLIB::ZLIB)
32+
add_custom_target(ZLIB)
33+
else()
34+
include(${CMAKE_CURRENT_LIST_DIR}/build_zlib.cmake)
35+
endif()
3336
# --- HDF5
3437
# https://forum.hdfgroup.org/t/issues-when-using-hdf5-as-a-git-submodule-and-using-cmake-with-add-subdirectory/7189/2
3538

0 commit comments

Comments
 (0)