Browse Source

Don't build zlib if ASSIMP_BUILD_ZLIB=OFF

Shaun Reed 2 years ago
parent
commit
37903f8ed2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      CMakeLists.txt

+ 5 - 1
CMakeLists.txt

@@ -482,7 +482,11 @@ ELSE()
     FIND_PACKAGE(ZLIB)
   ENDIF()
 
-  IF( NOT ZLIB_FOUND )
+  IF ( NOT ZLIB_FOUND AND NOT ASSIMP_BUILD_ZLIB )
+    message( FATAL_ERROR
+      "Build configured with -DASSIMP_BUILD_ZLIB=OFF but unable to find zlib"
+    )
+  ELSEIF( NOT ZLIB_FOUND )
     MESSAGE(STATUS "compiling zlib from sources")
     INCLUDE(CheckIncludeFile)
     INCLUDE(CheckTypeSize)