Skip to content

Commit

Permalink
COMP: modify zlib-ng to make it build within ITK
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Sep 8, 2021
1 parent cd3769e commit 3bcc933
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Modules/ThirdParty/ZLIB/src/itkzlib-ng/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ endmacro()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DZLIB_DEBUG")

if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
# set(CMAKE_DEBUG_POSTFIX "d") # ITK change: ITK handles debug suffixes
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
Expand Down Expand Up @@ -940,12 +940,12 @@ if(WITH_GZFILEOP)
endif()

if(NOT DEFINED BUILD_SHARED_LIBS)
add_library(zlib SHARED ${ZLIB_ALL_SRCS})
add_library(zlibstatic STATIC ${ZLIB_ALL_SRCS})
itk_module_add_library(zlib SHARED ${ZLIB_ALL_SRCS}) # ITK change
itk_module_add_library(zlibstatic STATIC ${ZLIB_ALL_SRCS}) # ITK change

set(ZLIB_INSTALL_LIBRARIES zlib zlibstatic)
else()
add_library(zlib ${ZLIB_ALL_SRCS})
itk_module_add_library(zlib ${ZLIB_ALL_SRCS}) # ITK change

if(NOT BUILD_SHARED_LIBS)
add_library(zlibstatic ALIAS zlib)
Expand All @@ -960,6 +960,7 @@ foreach(ZLIB_INSTALL_LIBRARY ${ZLIB_INSTALL_LIBRARIES})
"$<INSTALL_INTERFACE:include>")
endforeach()

if(FALSE) # ITK change: don't give custom name to the library
if(WIN32)
# Shared library
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
Expand All @@ -983,6 +984,7 @@ else()
# On unix-like platforms the library is almost always called libz
set_target_properties(${ZLIB_INSTALL_LIBRARIES} PROPERTIES OUTPUT_NAME z${SUFFIX})
endif()
endif() # ITK change

if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
Expand Down

0 comments on commit 3bcc933

Please sign in to comment.