From 9aa6ec73ba6da0ea4bebe5671b8866d4112a6a3b Mon Sep 17 00:00:00 2001 From: Minmin Gong Date: Thu, 28 Jan 2021 23:20:18 -0800 Subject: [PATCH] Export zlib if it's built outside --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a02a1bdb..270e49dd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()