Use hunter to download dependencies if HUNTER_ENABLED is ON

pull/2488/head
Rahul Sheth 2019-05-24 16:13:55 -04:00 committed by Rahul Sheth
parent 1db3e1e11f
commit a4587e8609
3 changed files with 237 additions and 149 deletions

View File

@ -34,8 +34,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#---------------------------------------------------------------------- #----------------------------------------------------------------------
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
# Toggles the use of the hunter package manager # Toggles the use of the hunter package manager
option(HUNTER_ENABLED "Enable Hunter package manager support" OFF) option(HUNTER_ENABLED "Enable Hunter package manager support" OFF)
@ -77,7 +76,7 @@ OPTION( ASSIMP_NO_EXPORT
) )
OPTION( ASSIMP_BUILD_ZLIB OPTION( ASSIMP_BUILD_ZLIB
"Build your own zlib" "Build your own zlib"
OFF OFF
) )
OPTION( ASSIMP_BUILD_ASSIMP_TOOLS OPTION( ASSIMP_BUILD_ASSIMP_TOOLS
"If the supplementary tools for Assimp are built in addition to the library." "If the supplementary tools for Assimp are built in addition to the library."
@ -366,7 +365,7 @@ ELSE()
ENDIF() ENDIF()
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE) CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config-version.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" @ONLY IMMEDIATE)
#we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...) #we should generated these scripts after CMake VERSION 3.0.2 using export(EXPORT ...) and write_basic_package_version_file(...)
INSTALL(FILES INSTALL(FILES
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config-version.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake"
@ -386,48 +385,57 @@ ENDIF( SYSTEM_IRRXML )
# Search for external dependencies, and build them from source if not found # Search for external dependencies, and build them from source if not found
# Search for zlib # Search for zlib
IF ( NOT ASSIMP_BUILD_ZLIB ) IF(HUNTER_ENABLED)
FIND_PACKAGE(ZLIB) hunter_add_package(ZLIB)
ENDIF( NOT ASSIMP_BUILD_ZLIB ) find_package(ZLIB CONFIG REQUIRED)
IF( NOT ZLIB_FOUND ) add_definitions(-DASSIMP_BUILD_NO_OWN_ZLIB)
MESSAGE(STATUS "compiling zlib from sources") set(ZLIB_FOUND TRUE)
INCLUDE(CheckIncludeFile) set(ZLIB_LIBRARIES ZLIB::zlib)
INCLUDE(CheckTypeSize) set(ASSIMP_BUILD_MINIZIP TRUE)
INCLUDE(CheckFunctionExists) ELSE(HUNTER_ENABLED)
IF ( NOT ASSIMP_BUILD_ZLIB )
FIND_PACKAGE(ZLIB)
ENDIF( NOT ASSIMP_BUILD_ZLIB )
# Explicitly turn off ASM686 and AMD64 cmake options. IF( NOT ZLIB_FOUND )
# The AMD64 option causes a build failure on MSVC and the ASM builds seem to have problems: MESSAGE(STATUS "compiling zlib from sources")
# https://github.com/madler/zlib/issues/41#issuecomment-125848075 INCLUDE(CheckIncludeFile)
# Also prevents these options from "polluting" the cmake options if assimp is being INCLUDE(CheckTypeSize)
# included as a submodule. INCLUDE(CheckFunctionExists)
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 # Explicitly turn off ASM686 and AMD64 cmake options.
ADD_SUBDIRECTORY(contrib/zlib) # The AMD64 option causes a build failure on MSVC and the ASM builds seem to have problems:
SET(ZLIB_FOUND 1) # https://github.com/madler/zlib/issues/41#issuecomment-125848075
SET(ZLIB_LIBRARIES zlibstatic) # Also prevents these options from "polluting" the cmake options if assimp is being
SET(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib) # included as a submodule.
# need to ensure we don't link with system zlib or minizip as well. set( ASM686 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
SET(ASSIMP_BUILD_MINIZIP 1) set( AMD64 FALSE CACHE INTERNAL "Override ZLIB flag to turn off assembly" FORCE )
ELSE(NOT ZLIB_FOUND)
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
SET(ZLIB_LIBRARIES_LINKED -lz)
ENDIF(NOT ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
# Search for unzip # compile from sources
IF ( NOT IOS ) 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(NOT ZLIB_FOUND)
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
SET(ZLIB_LIBRARIES_LINKED -lz)
ENDIF(NOT ZLIB_FOUND)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
ENDIF(HUNTER_ENABLED)
IF( NOT IOS )
IF( NOT ASSIMP_BUILD_MINIZIP ) IF( NOT ASSIMP_BUILD_MINIZIP )
use_pkgconfig(UNZIP minizip) use_pkgconfig(UNZIP minizip)
ENDIF( NOT ASSIMP_BUILD_MINIZIP ) ENDIF( NOT ASSIMP_BUILD_MINIZIP )
ELSE ( NOT IOS ) ELSE ( NOT IOS )
IF(NOT BUILD_SHARED_LIBS) IF( NOT BUILD_SHARED_LIBS )
IF( NOT ASSIMP_BUILD_MINIZIP ) IF( NOT ASSIMP_BUILD_MINIZIP )
use_pkgconfig(UNZIP minizip) use_pkgconfig(UNZIP minizip)
ENDIF( NOT ASSIMP_BUILD_MINIZIP ) ENDIF( NOT ASSIMP_BUILD_MINIZIP )
ENDIF (NOT BUILD_SHARED_LIBS) ENDIF ( NOT BUILD_SHARED_LIBS )
ENDIF ( NOT IOS ) ENDIF ( NOT IOS )
IF ( ASSIMP_NO_EXPORT ) IF ( ASSIMP_NO_EXPORT )
@ -501,7 +509,9 @@ ELSE (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER ) ADD_DEFINITIONS( -DASSIMP_BUILD_NO_C4D_IMPORTER )
ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) ENDIF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
ADD_SUBDIRECTORY(contrib) IF(NOT HUNTER_ENABLED)
ADD_SUBDIRECTORY(contrib)
ENDIF(NOT HUNTER_ENABLED)
ADD_SUBDIRECTORY( code/ ) ADD_SUBDIRECTORY( code/ )
IF ( ASSIMP_BUILD_ASSIMP_TOOLS ) IF ( ASSIMP_BUILD_ASSIMP_TOOLS )

View File

@ -43,7 +43,7 @@
# 3) Add libassimp using the file lists (eliminates duplication of file names between # 3) Add libassimp using the file lists (eliminates duplication of file names between
# source groups and library command) # source groups and library command)
# #
cmake_minimum_required( VERSION 2.6 ) cmake_minimum_required( VERSION 3.0 )
SET( HEADER_PATH ../include/assimp ) SET( HEADER_PATH ../include/assimp )
if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM) if(NOT ANDROID AND ASSIMP_ANDROID_JNIIOSYSTEM)
@ -267,7 +267,7 @@ MACRO(ADD_ASSIMP_EXPORTER name)
ELSE () ELSE ()
set(ASSIMP_EXPORTER_ENABLED ${ASSIMP_BUILD_${name}_EXPORTER}) set(ASSIMP_EXPORTER_ENABLED ${ASSIMP_BUILD_${name}_EXPORTER})
ENDIF () ENDIF ()
IF (ASSIMP_EXPORTER_ENABLED) IF (ASSIMP_EXPORTER_ENABLED)
SET(ASSIMP_EXPORTERS_ENABLED "${ASSIMP_EXPORTERS_ENABLED} ${name}") SET(ASSIMP_EXPORTERS_ENABLED "${ASSIMP_EXPORTERS_ENABLED} ${name}")
LIST(APPEND ASSIMP_EXPORTER_SRCS ${ARGN}) LIST(APPEND ASSIMP_EXPORTER_SRCS ${ARGN})
@ -848,116 +848,173 @@ SET( Extra_SRCS
) )
SOURCE_GROUP( Extra FILES ${Extra_SRCS}) SOURCE_GROUP( Extra FILES ${Extra_SRCS})
SET( Clipper_SRCS # irrXML
../contrib/clipper/clipper.hpp IF(HUNTER_ENABLED)
../contrib/clipper/clipper.cpp hunter_add_package(irrXML)
) find_package(irrXML CONFIG REQUIRED)
SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS}) ELSE(HUNTER_ENABLED)
# irrXML already included in contrib directory by parent CMakeLists.txt.
ENDIF(HUNTER_ENABLED)
SET( Poly2Tri_SRCS # utf8
../contrib/poly2tri/poly2tri/common/shapes.cc IF(HUNTER_ENABLED)
../contrib/poly2tri/poly2tri/common/shapes.h hunter_add_package(utf8)
../contrib/poly2tri/poly2tri/common/utils.h find_package(utf8 CONFIG REQUIRED)
../contrib/poly2tri/poly2tri/sweep/advancing_front.h ELSE(HUNTER_ENABLED)
../contrib/poly2tri/poly2tri/sweep/advancing_front.cc # utf8 is header-only, so Assimp doesn't need to do anything.
../contrib/poly2tri/poly2tri/sweep/cdt.cc ENDIF(HUNTER_ENABLED)
../contrib/poly2tri/poly2tri/sweep/cdt.h
../contrib/poly2tri/poly2tri/sweep/sweep.cc
../contrib/poly2tri/poly2tri/sweep/sweep.h
../contrib/poly2tri/poly2tri/sweep/sweep_context.cc
../contrib/poly2tri/poly2tri/sweep/sweep_context.h
)
SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
SET( unzip_SRCS # polyclipping
../contrib/unzip/crypt.h IF(HUNTER_ENABLED)
../contrib/unzip/ioapi.c hunter_add_package(polyclipping)
../contrib/unzip/ioapi.h find_package(polyclipping CONFIG REQUIRED)
../contrib/unzip/unzip.c ELSE(HUNTER_ENABLED)
../contrib/unzip/unzip.h SET( Clipper_SRCS
) ../contrib/clipper/clipper.hpp
SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS}) ../contrib/clipper/clipper.cpp
)
SOURCE_GROUP( Contrib\\Clipper FILES ${Clipper_SRCS})
ENDIF(HUNTER_ENABLED)
SET( ziplib_SRCS # poly2tri
../contrib/zip/src/miniz.h IF(HUNTER_ENABLED)
../contrib/zip/src/zip.c hunter_add_package(poly2tri)
../contrib/zip/src/zip.h find_package(poly2tri CONFIG REQUIRED)
) ELSE(HUNTER_ENABLED)
SET( Poly2Tri_SRCS
../contrib/poly2tri/poly2tri/common/shapes.cc
../contrib/poly2tri/poly2tri/common/shapes.h
../contrib/poly2tri/poly2tri/common/utils.h
../contrib/poly2tri/poly2tri/sweep/advancing_front.h
../contrib/poly2tri/poly2tri/sweep/advancing_front.cc
../contrib/poly2tri/poly2tri/sweep/cdt.cc
../contrib/poly2tri/poly2tri/sweep/cdt.h
../contrib/poly2tri/poly2tri/sweep/sweep.cc
../contrib/poly2tri/poly2tri/sweep/sweep.h
../contrib/poly2tri/poly2tri/sweep/sweep_context.cc
../contrib/poly2tri/poly2tri/sweep/sweep_context.h
)
SOURCE_GROUP( Contrib\\Poly2Tri FILES ${Poly2Tri_SRCS})
ENDIF(HUNTER_ENABLED)
# TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only # minizip/unzip
if(${CMAKE_VERSION} VERSION_LESS "3.12.0") IF(HUNTER_ENABLED)
add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) hunter_add_package(minizip)
else() find_package(minizip CONFIG REQUIRED)
add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0) ELSE(HUNTER_ENABLED)
endif() SET( unzip_SRCS
../contrib/unzip/crypt.h
../contrib/unzip/ioapi.c
../contrib/unzip/ioapi.h
../contrib/unzip/unzip.c
../contrib/unzip/unzip.h
)
SOURCE_GROUP(Contrib\\unzip FILES ${unzip_SRCS})
ENDIF(HUNTER_ENABLED)
SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} ) # zip (https://github.com/kuba--/zip)
IF(HUNTER_ENABLED)
hunter_add_package(zip)
find_package(zip CONFIG REQUIRED)
ELSE(HUNTER_ENABLED)
SET( ziplib_SRCS
../contrib/zip/src/miniz.h
../contrib/zip/src/zip.c
../contrib/zip/src/zip.h
)
SET ( openddl_parser_SRCS # TODO if cmake required version has been updated to >3.12.0, collapse this to the second case only
../contrib/openddlparser/code/OpenDDLParser.cpp if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
../contrib/openddlparser/code/DDLNode.cpp add_definitions(-DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
../contrib/openddlparser/code/OpenDDLCommon.cpp else()
../contrib/openddlparser/code/OpenDDLExport.cpp add_compile_definitions(MINIZ_USE_UNALIGNED_LOADS_AND_STORES=0)
../contrib/openddlparser/code/Value.cpp endif()
../contrib/openddlparser/code/OpenDDLStream.cpp
../contrib/openddlparser/include/openddlparser/OpenDDLParser.h
../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h
../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h
../contrib/openddlparser/include/openddlparser/OpenDDLExport.h
../contrib/openddlparser/include/openddlparser/OpenDDLStream.h
../contrib/openddlparser/include/openddlparser/DDLNode.h
../contrib/openddlparser/include/openddlparser/Value.h
)
SOURCE_GROUP( Contrib\\openddl_parser FILES ${openddl_parser_SRCS})
SET ( open3dgc_SRCS SOURCE_GROUP( ziplib FILES ${ziplib_SRCS} )
../contrib/Open3DGC/o3dgcAdjacencyInfo.h ENDIF(HUNTER_ENABLED)
../contrib/Open3DGC/o3dgcArithmeticCodec.cpp
../contrib/Open3DGC/o3dgcArithmeticCodec.h # openddlparser
../contrib/Open3DGC/o3dgcBinaryStream.h IF(HUNTER_ENABLED)
../contrib/Open3DGC/o3dgcCommon.h hunter_add_package(openddlparser)
../contrib/Open3DGC/o3dgcDVEncodeParams.h find_package(openddlparser CONFIG REQUIRED)
../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp ELSE(HUNTER_ENABLED)
../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h SET ( openddl_parser_SRCS
../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp ../contrib/openddlparser/code/OpenDDLParser.cpp
../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h ../contrib/openddlparser/code/DDLNode.cpp
../contrib/Open3DGC/o3dgcDynamicVector.h ../contrib/openddlparser/code/OpenDDLCommon.cpp
../contrib/Open3DGC/o3dgcFIFO.h ../contrib/openddlparser/code/OpenDDLExport.cpp
../contrib/Open3DGC/o3dgcIndexedFaceSet.h ../contrib/openddlparser/code/Value.cpp
../contrib/Open3DGC/o3dgcIndexedFaceSet.inl ../contrib/openddlparser/code/OpenDDLStream.cpp
../contrib/Open3DGC/o3dgcSC3DMCDecoder.h ../contrib/openddlparser/include/openddlparser/OpenDDLParser.h
../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl ../contrib/openddlparser/include/openddlparser/OpenDDLParserUtils.h
../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h ../contrib/openddlparser/include/openddlparser/OpenDDLCommon.h
../contrib/Open3DGC/o3dgcSC3DMCEncoder.h ../contrib/openddlparser/include/openddlparser/OpenDDLExport.h
../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl ../contrib/openddlparser/include/openddlparser/OpenDDLStream.h
../contrib/Open3DGC/o3dgcTimer.h ../contrib/openddlparser/include/openddlparser/DDLNode.h
../contrib/Open3DGC/o3dgcTools.cpp ../contrib/openddlparser/include/openddlparser/Value.h
../contrib/Open3DGC/o3dgcTriangleFans.cpp )
../contrib/Open3DGC/o3dgcTriangleFans.h SOURCE_GROUP( Contrib\\openddl_parser FILES ${openddl_parser_SRCS})
../contrib/Open3DGC/o3dgcTriangleListDecoder.h ENDIF(HUNTER_ENABLED)
../contrib/Open3DGC/o3dgcTriangleListDecoder.inl
../contrib/Open3DGC/o3dgcTriangleListEncoder.h # Open3DGC
../contrib/Open3DGC/o3dgcTriangleListEncoder.inl IF(HUNTER_ENABLED)
../contrib/Open3DGC/o3dgcVector.h # Nothing to do, not available in Hunter yet.
../contrib/Open3DGC/o3dgcVector.inl ELSE(HUNTER_ENABLED)
) SET ( open3dgc_SRCS
SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS}) ../contrib/Open3DGC/o3dgcAdjacencyInfo.h
../contrib/Open3DGC/o3dgcArithmeticCodec.cpp
../contrib/Open3DGC/o3dgcArithmeticCodec.h
../contrib/Open3DGC/o3dgcBinaryStream.h
../contrib/Open3DGC/o3dgcCommon.h
../contrib/Open3DGC/o3dgcDVEncodeParams.h
../contrib/Open3DGC/o3dgcDynamicVectorDecoder.cpp
../contrib/Open3DGC/o3dgcDynamicVectorDecoder.h
../contrib/Open3DGC/o3dgcDynamicVectorEncoder.cpp
../contrib/Open3DGC/o3dgcDynamicVectorEncoder.h
../contrib/Open3DGC/o3dgcDynamicVector.h
../contrib/Open3DGC/o3dgcFIFO.h
../contrib/Open3DGC/o3dgcIndexedFaceSet.h
../contrib/Open3DGC/o3dgcIndexedFaceSet.inl
../contrib/Open3DGC/o3dgcSC3DMCDecoder.h
../contrib/Open3DGC/o3dgcSC3DMCDecoder.inl
../contrib/Open3DGC/o3dgcSC3DMCEncodeParams.h
../contrib/Open3DGC/o3dgcSC3DMCEncoder.h
../contrib/Open3DGC/o3dgcSC3DMCEncoder.inl
../contrib/Open3DGC/o3dgcTimer.h
../contrib/Open3DGC/o3dgcTools.cpp
../contrib/Open3DGC/o3dgcTriangleFans.cpp
../contrib/Open3DGC/o3dgcTriangleFans.h
../contrib/Open3DGC/o3dgcTriangleListDecoder.h
../contrib/Open3DGC/o3dgcTriangleListDecoder.inl
../contrib/Open3DGC/o3dgcTriangleListEncoder.h
../contrib/Open3DGC/o3dgcTriangleListEncoder.inl
../contrib/Open3DGC/o3dgcVector.h
../contrib/Open3DGC/o3dgcVector.inl
)
SOURCE_GROUP( Contrib\\open3dgc FILES ${open3dgc_SRCS})
ENDIF(HUNTER_ENABLED)
# Check dependencies for glTF importer with Open3DGC-compression. # Check dependencies for glTF importer with Open3DGC-compression.
# RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file # RT-extensions is used in "contrib/Open3DGC/o3dgcTimer.h" for collecting statistics. Pointed file
# has implementation for different platforms: WIN32, __MACH__ and other ("else" block). # has implementation for different platforms: WIN32, __MACH__ and other ("else" block).
FIND_PACKAGE(RT QUIET) FIND_PACKAGE(RT QUIET)
IF (RT_FOUND OR MSVC) IF (NOT HUNTER_ENABLED AND (RT_FOUND OR MSVC))
SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 ) SET( ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC 1 )
ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 ) ADD_DEFINITIONS( -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 )
ELSE () ELSE ()
SET (open3dgc_SRCS "") SET (open3dgc_SRCS "")
MESSAGE (INFO " RT-extension not found. glTF import/export will be built without Open3DGC-compression.") MESSAGE (INFO " Hunter enabled or RT-extension not found. glTF import/export will be built without Open3DGC-compression.")
#!TODO: off course is better to remove statistics timers from o3dgc codec. Or propose to choose what to use. #!TODO: off course is better to remove statistics timers from o3dgc codec. Or propose to choose what to use.
ENDIF () ENDIF ()
INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" ) # RapidJSON
INCLUDE_DIRECTORIES( "../contrib" ) IF(HUNTER_ENABLED)
hunter_add_package(RapidJSON)
find_package(RapidJSON CONFIG REQUIRED)
ELSE(HUNTER_ENABLED)
INCLUDE_DIRECTORIES( "../contrib/rapidjson/include" )
INCLUDE_DIRECTORIES( "../contrib" )
ENDIF(HUNTER_ENABLED)
# VC2010 fixes # VC2010 fixes
if(MSVC10) if(MSVC10)
@ -974,12 +1031,14 @@ if ( MSVC )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS ) ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
endif ( MSVC ) endif ( MSVC )
if (UNZIP_FOUND) IF(NOT HUNTER_ENABLED)
SET (unzip_compile_SRCS "") if (UNZIP_FOUND)
else (UNZIP_FOUND) SET (unzip_compile_SRCS "")
SET (unzip_compile_SRCS ${unzip_SRCS}) else (UNZIP_FOUND)
INCLUDE_DIRECTORIES( "../contrib/unzip/" ) SET (unzip_compile_SRCS ${unzip_SRCS})
endif (UNZIP_FOUND) INCLUDE_DIRECTORIES( "../contrib/unzip/" )
endif (UNZIP_FOUND)
ENDIF(NOT HUNTER_ENABLED)
MESSAGE(STATUS "Enabled importer formats:${ASSIMP_IMPORTERS_ENABLED}") MESSAGE(STATUS "Enabled importer formats:${ASSIMP_IMPORTERS_ENABLED}")
MESSAGE(STATUS "Disabled importer formats:${ASSIMP_IMPORTERS_DISABLED}") MESSAGE(STATUS "Disabled importer formats:${ASSIMP_IMPORTERS_DISABLED}")
@ -1018,10 +1077,12 @@ SET( assimp_src
) )
ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD ) ADD_DEFINITIONS( -DOPENDDLPARSER_BUILD )
INCLUDE_DIRECTORIES( IF(NOT HUNTER_ENABLED)
${IRRXML_INCLUDE_DIR} INCLUDE_DIRECTORIES(
../contrib/openddlparser/include ${IRRXML_INCLUDE_DIR}
) ../contrib/openddlparser/include
)
ENDIF(NOT HUNTER_ENABLED)
IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER) IF (ASSIMP_BUILD_NONFREE_C4D_IMPORTER)
SET( assimp_src ${assimp_src} ${C4D_SRCS}) SET( assimp_src ${assimp_src} ${C4D_SRCS})
@ -1037,7 +1098,22 @@ TARGET_INCLUDE_DIRECTORIES ( assimp PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
) )
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} ) IF(HUNTER_ENABLED)
TARGET_LINK_LIBRARIES(assimp
PUBLIC
polyclipping::polyclipping
irrXML::irrXML
openddlparser::openddl_parser
poly2tri::poly2tri
minizip::minizip
ZLIB::zlib
RapidJSON::rapidjson
utf8::utf8
zip::zip
)
ELSE(HUNTER_ENABLED)
TARGET_LINK_LIBRARIES(assimp ${ZLIB_LIBRARIES} ${OPENDDL_PARSER_LIBRARIES} ${IRRXML_LIBRARY} )
ENDIF(HUNTER_ENABLED)
if(ASSIMP_ANDROID_JNIIOSYSTEM) if(ASSIMP_ANDROID_JNIIOSYSTEM)
set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI) set(ASSIMP_ANDROID_JNIIOSYSTEM_PATH port/AndroidJNI)
@ -1119,12 +1195,14 @@ ENDIF(APPLE)
# Build against external unzip, or add ../contrib/unzip so # Build against external unzip, or add ../contrib/unzip so
# assimp can #include "unzip.h" # assimp can #include "unzip.h"
if (UNZIP_FOUND) IF(NOT HUNTER_ENABLED)
INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS}) if (UNZIP_FOUND)
TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES}) INCLUDE_DIRECTORIES(${UNZIP_INCLUDE_DIRS})
else (UNZIP_FOUND) TARGET_LINK_LIBRARIES(assimp ${UNZIP_LIBRARIES})
INCLUDE_DIRECTORIES("../") else (UNZIP_FOUND)
endif (UNZIP_FOUND) INCLUDE_DIRECTORIES("../")
endif (UNZIP_FOUND)
ENDIF(NOT HUNTER_ENABLED)
# Add RT-extension library for glTF importer with Open3DGC-compression. # Add RT-extension library for glTF importer with Open3DGC-compression.
IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC) IF (RT_FOUND AND ASSIMP_IMPORTER_GLTF_USE_OPEN3DGC)

View File

@ -37,7 +37,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
#---------------------------------------------------------------------- #----------------------------------------------------------------------
cmake_minimum_required( VERSION 2.6 ) cmake_minimum_required( VERSION 3.0 )
INCLUDE_DIRECTORIES( INCLUDE_DIRECTORIES(
${Assimp_SOURCE_DIR}/contrib/gtest/include ${Assimp_SOURCE_DIR}/contrib/gtest/include