Compare commits

...

15 Commits

Author SHA1 Message Date
Kim Kulling 521460d7a0
Update CMakeLists.txt 2021-01-28 20:34:24 +01:00
Kim Kulling b2395cd725
Update CMakeLists.txt 2021-01-28 20:19:47 +01:00
Kim Kulling 250660375e
Merge branch 'master' into static_zlib 2021-01-27 20:08:05 +01:00
Kim Kulling adf83a6193
Update ccpp.yml 2021-01-27 19:55:17 +01:00
Kim Kulling 6e375ca1a7
Update CMakeLists.txt 2021-01-27 19:53:11 +01:00
Kim Kulling f7c76fae52
Merge branch 'master' into static_zlib 2021-01-26 18:52:45 +01:00
Kim Kulling b6f577d7c4
Fix typo in ci script 2021-01-26 09:25:28 +01:00
Kim Kulling 4fa8840678
Merge branch 'master' into static_zlib 2021-01-26 09:22:14 +01:00
kimkulling 534037f76b enable own zlib build in ci for windows 2021-01-26 09:14:06 +01:00
kimkulling 011ec086ca ensure shared dlls are exporting zlib symbols 2021-01-20 12:47:14 +01:00
kimkulling 77d710bc64 add missing include 2021-01-20 11:01:20 +01:00
kimkulling 4b14b702ae Fix try 2021-01-20 10:42:46 +01:00
kkulling 109ded407d Merge branch 'master' of https://github.com/assimp/assimp 2021-01-20 08:46:19 +01:00
kkulling c1001c0e07 Merge branch 'master' of https://github.com/assimp/assimp 2020-03-23 11:46:29 +01:00
kimkulling 888301918e Merge branch 'master' of https://github.com/assimp/assimp 2020-03-09 10:57:19 +01:00
2 changed files with 84 additions and 31 deletions

View File

@ -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 )

View File

@ -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}