From 410b54d4b84561b59a3b6bf12b49aa05c2069e9e Mon Sep 17 00:00:00 2001 From: Brendan Hack Date: Mon, 9 Jul 2018 08:41:42 +1000 Subject: [PATCH] When building local zlib ensure we don't link to any system zlib or minzip. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d13db57a..91e4db510 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,6 +320,8 @@ IF( NOT ZLIB_FOUND ) SET(ZLIB_FOUND 1) SET(ZLIB_LIBRARIES zlibstatic) SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib) + # need to ensure we don't link with system zlib or minizip as well. + SET(ASSIMP_BUILD_MINIZIP 1) ELSE(NOT ZLIB_FOUND) ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB) SET(ZLIB_LIBRARIES_LINKED -lz) @@ -327,7 +329,9 @@ ENDIF(NOT ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) # Search for unzip -use_pkgconfig(UNZIP minizip) +IF( NOT ASSIMP_BUILD_MINIZIP ) + use_pkgconfig(UNZIP minizip) +ENDIF( NOT ASSIMP_BUILD_MINIZIP ) IF ( ASSIMP_NO_EXPORT ) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)