Compare commits
15 Commits
master
...
static_zli
Author | SHA1 | Date |
---|---|---|
Kim Kulling | 521460d7a0 | |
Kim Kulling | b2395cd725 | |
Kim Kulling | 250660375e | |
Kim Kulling | adf83a6193 | |
Kim Kulling | 6e375ca1a7 | |
Kim Kulling | f7c76fae52 | |
Kim Kulling | b6f577d7c4 | |
Kim Kulling | 4fa8840678 | |
kimkulling | 534037f76b | |
kimkulling | 011ec086ca | |
kimkulling | 77d710bc64 | |
kimkulling | 4b14b702ae | |
kkulling | 109ded407d | |
kkulling | c1001c0e07 | |
kimkulling | 888301918e |
|
@ -83,7 +83,7 @@ OPTION( ASSIMP_NO_EXPORT
|
|||
)
|
||||
OPTION( ASSIMP_BUILD_ZLIB
|
||||
"Build your own zlib"
|
||||
OFF
|
||||
ON
|
||||
)
|
||||
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
|
||||
"If the supplementary tools for Assimp are built in addition to the library."
|
||||
|
@ -443,46 +443,46 @@ ENDIF()
|
|||
|
||||
# Search for external dependencies, and build them from source if not found
|
||||
# Search for zlib
|
||||
IF(ASSIMP_HUNTER_ENABLED)
|
||||
hunter_add_package(ZLIB)
|
||||
find_package(ZLIB CONFIG REQUIRED)
|
||||
#IF(ASSIMP_HUNTER_ENABLED)
|
||||
# hunter_add_package(ZLIB)
|
||||
# find_package(ZLIB CONFIG REQUIRED)#
|
||||
|
||||
add_definitions(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
set(ZLIB_LIBRARIES ZLIB::zlib)
|
||||
set(ASSIMP_BUILD_MINIZIP TRUE)
|
||||
ELSE()
|
||||
IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||
FIND_PACKAGE(ZLIB)
|
||||
ENDIF()
|
||||
# add_definitions(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
# set(ZLIB_FOUND TRUE)
|
||||
# set(ZLIB_LIBRARIES ZLIB::zlib)
|
||||
# set(ASSIMP_BUILD_MINIZIP TRUE)
|
||||
#ELSE()
|
||||
# IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||
# FIND_PACKAGE(ZLIB)
|
||||
# ENDIF()
|
||||
|
||||
IF( NOT ZLIB_FOUND )
|
||||
MESSAGE(STATUS "compiling zlib from sources")
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckTypeSize)
|
||||
INCLUDE(CheckFunctionExists)
|
||||
# IF( NOT ZLIB_FOUND )
|
||||
# MESSAGE(STATUS "compiling zlib from sources")
|
||||
# INCLUDE(CheckIncludeFile)
|
||||
# INCLUDE(CheckTypeSize)
|
||||
# INCLUDE(CheckFunctionExists)
|
||||
|
||||
# Explicitly turn off ASM686 and AMD64 cmake options.
|
||||
# The AMD64 option causes a build failure on MSVC and the ASM builds seem to have problems:
|
||||
# https://github.com/madler/zlib/issues/41#issuecomment-125848075
|
||||
# Also prevents these options from "polluting" the cmake options if assimp is being
|
||||
# included as a submodule.
|
||||
set( ASM686 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
set( AMD64 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
# set( ASM686 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
# set( AMD64 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
|
||||
# compile from sources
|
||||
ADD_SUBDIRECTORY(contrib/zlib)
|
||||
SET(ZLIB_FOUND 1)
|
||||
SET(ZLIB_LIBRARIES zlibstatic)
|
||||
SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
|
||||
# ADD_SUBDIRECTORY(contrib/zlib)
|
||||
# SET(ZLIB_FOUND 1)
|
||||
# SET(ZLIB_LIBRARIES zlibstatic)
|
||||
# SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
|
||||
# need to ensure we don't link with system zlib or minizip as well.
|
||||
SET(ASSIMP_BUILD_MINIZIP 1)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
SET(ZLIB_LIBRARIES_LINKED -lz)
|
||||
ENDIF()
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
# SET(ASSIMP_BUILD_MINIZIP 1)
|
||||
#ELSE()
|
||||
# ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
# SET(ZLIB_LIBRARIES_LINKED -lz)
|
||||
# ENDIF()
|
||||
# INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
#ENDIF()
|
||||
|
||||
IF( NOT IOS )
|
||||
IF( NOT ASSIMP_BUILD_MINIZIP )
|
||||
|
|
|
@ -955,6 +955,59 @@ ELSE()
|
|||
SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
|
||||
ENDIF()
|
||||
|
||||
IF(ASSIMP_HUNTER_ENABLED)
|
||||
hunter_add_package(ZLIB)
|
||||
find_package(ZLIB CONFIG REQUIRED)
|
||||
|
||||
add_definitions(-DASSIMP_BUILD_NO_OWN_ZLIB)
|
||||
set(ZLIB_FOUND TRUE)
|
||||
set(ZLIB_LIBRARIES ZLIB::zlib)
|
||||
set(ASSIMP_BUILD_MINIZIP TRUE)
|
||||
SET(ZLIB_LIBRARIES_LINKED -lz)
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
ELSE()
|
||||
IF ( NOT ASSIMP_BUILD_ZLIB )
|
||||
FIND_PACKAGE(ZLIB CONFIG REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
ELSE()
|
||||
IF( BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DZLIB_DLL)
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "compiling zlib from sources")
|
||||
configure_file(../contrib/zlib/zconf.h.cmakein ../contrib/zlib/zconf.h @ONLY)
|
||||
SET( zlib_SRCS
|
||||
../contrib/zlib/crc32.h
|
||||
../contrib/zlib/deflate.h
|
||||
../contrib/zlib/gzguts.h
|
||||
../contrib/zlib/inffast.h
|
||||
../contrib/zlib/inffixed.h
|
||||
../contrib/zlib/inflate.h
|
||||
../contrib/zlib/inftrees.h
|
||||
../contrib/zlib/trees.h
|
||||
../contrib/zlib/zutil.h
|
||||
../contrib/zlib/adler32.c
|
||||
../contrib/zlib/compress.c
|
||||
../contrib/zlib/crc32.c
|
||||
../contrib/zlib/deflate.c
|
||||
../contrib/zlib/gzclose.c
|
||||
../contrib/zlib/gzlib.c
|
||||
../contrib/zlib/gzread.c
|
||||
../contrib/zlib/gzwrite.c
|
||||
../contrib/zlib/inflate.c
|
||||
../contrib/zlib/infback.c
|
||||
../contrib/zlib/inftrees.c
|
||||
../contrib/zlib/inffast.c
|
||||
../contrib/zlib/trees.c
|
||||
../contrib/zlib/uncompr.c
|
||||
../contrib/zlib/zutil.c
|
||||
)
|
||||
INCLUDE_DIRECTORIES(../contrib/zlib/)
|
||||
SET( ASM686 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
SET( AMD64 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
|
||||
SOURCE_GROUP( zlib FILES ${zlib_SRCS} )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# openddlparser
|
||||
IF(ASSIMP_HUNTER_ENABLED)
|
||||
hunter_add_package(openddlparser)
|
||||
|
@ -1102,6 +1155,7 @@ SET( assimp_src
|
|||
${open3dgc_SRCS}
|
||||
${ziplib_SRCS}
|
||||
${Pugixml_SRCS}
|
||||
${zlib_SRCS}
|
||||
# Necessary to show the headers in the project when using the VC++ generator:
|
||||
|
||||
${PUBLIC_HEADERS}
|
||||
|
@ -1246,7 +1300,6 @@ IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)
|
|||
TARGET_LINK_LIBRARIES(assimp ${RT_LIBRARY})
|
||||
ENDIF ()
|
||||
|
||||
|
||||
INSTALL( TARGETS assimp
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR}
|
||||
|
|
Loading…
Reference in New Issue