Skip to content

Commit 9cb298c

Browse files
committed
COMP: Do not use system Zlib on Windows build
Results in various warnings.
1 parent 56a76a6 commit 9cb298c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Superbuild/External-ITK.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ if(APPLE)
4747
"-DBUILD_SHARED_LIBS:BOOL=ON"
4848
)
4949
endif()
50+
set(_windows_args)
51+
set(_zlib_deps zlib)
52+
if(WIN32)
53+
set(_windows_args
54+
"-DITK_USE_SYSTEM_ZLIB:BOOL=OFF"
55+
)
56+
set(_zlib_deps )
57+
endif()
5058

5159
ExternalProject_Add(ITK
5260
GIT_REPOSITORY "${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git"
@@ -71,8 +79,9 @@ ExternalProject_Add(ITK
7179
${_opencv_args}
7280
${_wrap_python_args}
7381
${_apple_args}
82+
${_windows_args}
7483
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "ITK install skipped"
75-
DEPENDS ${ITK_DEPENDENCIES} ${_python_depends} zlib
84+
DEPENDS ${ITK_DEPENDENCIES} ${_python_depends} ${_zlib_deps}
7685
LOG_BUILD 0
7786
)
7887

Superbuild/Superbuild.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ endif()
3131
set(ITKExamples_DEPENDENCIES )
3232
set(ITK_DEPENDENCIES )
3333

34-
# Used by ITK, VTK, and Python -- always build it.
35-
include(${CMAKE_SOURCE_DIR}/External-zlib.cmake)
34+
# Used by ITK, VTK, -- always build it.
35+
if(NOT WIN32 OR ITKExamples_USE_VTK AND NOT VTK_DIR)
36+
include(${CMAKE_SOURCE_DIR}/External-zlib.cmake)
37+
endif()
3638

3739
option(ITKExamples_USE_OpenCV "Add OpenCV to the superbuild" OFF)
3840
if(NOT OpenCV_DIR AND ITKExamples_USE_OpenCV)

0 commit comments

Comments
 (0)