Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,17 @@ if(TRX_ZLIB_TARGET AND NOT TARGET ZLIB::ZLIB)
# being present is a definitive indicator of an ITK build; use ITK's own
# module variable rather than trying to derive the path from the target.
if(TARGET ITKZLIBModule OR TARGET ITK::ITKZLIBModule)
set(ZLIB_INCLUDE_DIR "${ITKZLIB_INCLUDE_DIRS}")
set(ZLIB_FOUND TRUE)
# ITKZLIB_INCLUDE_DIRS is a list: in-tree builds have multiple entries
# (src/ and src/itkzlib-ng/ where zlib.h actually lives); installed
# builds have a single merged include dir. Find the entry with zlib.h.
foreach(_trx_zlib_dir IN LISTS ITKZLIB_INCLUDE_DIRS)
if(EXISTS "${_trx_zlib_dir}/zlib.h")
set(ZLIB_INCLUDE_DIR "${_trx_zlib_dir}")
set(ZLIB_FOUND TRUE)
break()
endif()
endforeach()
unset(_trx_zlib_dir)
endif()
endif()
endif()
Expand Down
Loading