浏览代码

Merge pull request #3620 from gongminmin/ExportZLib

Export zlib if it's built outside
Kim Kulling 4 年之前
父节点
当前提交
26ebeaea5c
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      CMakeLists.txt

+ 6 - 0
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()