Do not build ziplib when 3MF exporter is disabled.

pull/4173/head
Jeremie Dumas 2021-11-04 01:14:24 -07:00
parent 40f9d37a38
commit cedf1819c3
1 changed files with 22 additions and 18 deletions

View File

@ -934,24 +934,26 @@ ELSE()
ENDIF() ENDIF()
# zip (https://github.com/kuba--/zip) # zip (https://github.com/kuba--/zip)
IF(ASSIMP_HUNTER_ENABLED) IF(3MF IN_LIST ASSIMP_EXPORTERS_ENABLED)
hunter_add_package(zip) IF(ASSIMP_HUNTER_ENABLED)
find_package(zip CONFIG REQUIRED) hunter_add_package(zip)
ELSE() find_package(zip CONFIG REQUIRED)
SET( ziplib_SRCS ELSE()
../contrib/zip/src/miniz.h SET( ziplib_SRCS
../contrib/zip/src/zip.c ../contrib/zip/src/miniz.h
../contrib/zip/src/zip.h ../contrib/zip/src/zip.c
) ../contrib/zip/src/zip.h
)
# TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only # TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only
if(${CMAKE_VERSION} VERSION_LESS "3.12.0") if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
else() else()
add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
endif() endif()
SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} ) SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
ENDIF()
ENDIF() ENDIF()
# openddlparser # openddlparser
@ -1153,10 +1155,12 @@ IF(ASSIMP_HUNTER_ENABLED)
ZLIB::zlib ZLIB::zlib
RapidJSON::rapidjson RapidJSON::rapidjson
utf8cpp utf8cpp
zip::zip
pugixml pugixml
) )
if(TARGET zip::zip)
target_link_libraries(assimp PUBLIC zip::zip)
endif()
if (ASSIMP_BUILD_DRACO) if (ASSIMP_BUILD_DRACO)
target_link_libraries(assimp PUBLIC ${draco_LIBRARIES}) target_link_libraries(assimp PUBLIC ${draco_LIBRARIES})
endif() endif()