Export zlib if it's built outside

pull/3620/head
Minmin Gong 2021-01-28 23:20:18 -08:00
parent d87d9f2094
commit 9aa6ec73ba
1 changed files with 6 additions and 0 deletions

View File

@ -452,6 +452,12 @@ IF(ASSIMP_HUNTER_ENABLED)
set(ZLIB_LIBRARIES ZLIB::zlib)
set(ASSIMP_BUILD_MINIZIP TRUE)
ELSE()
# If the zlib is already found outside, add an export in case assimpTargets can't find it.
IF( ZLIB_FOUND )
INSTALL( TARGETS zlib
EXPORT "${TARGETS_EXPORT_NAME}")
ENDIF()
IF ( NOT ASSIMP_BUILD_ZLIB )
FIND_PACKAGE(ZLIB)
ENDIF()