Skip to content

Commit 3c36aa8

Browse files
committed
cmake: respect build_zlib option
1 parent 3d19bac commit 3c36aa8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmake/hdf5.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ endif()
4444

4545
if(TARGET ZLIB::ZLIB)
4646
add_custom_target(ZLIB)
47-
elseif(h5fortran_find)
47+
elseif(h5fortran_find AND NOT build_zlib)
4848
find_package(ZLIB)
49-
else()
49+
endif()
50+
51+
if(NOT TARGET ZLIB::ZLIB)
5052
include(${CMAKE_CURRENT_LIST_DIR}/zlib.cmake)
5153
endif()
5254

0 commit comments

Comments
 (0)