From 53ae7e329ce1f22dc40cb823c9bdc2c97cfec228 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 23 Jun 2016 14:32:14 +0300 Subject: [PATCH] Depends on Boost --- CMakeLists.txt | 31 ++++++++++++++++++------------- cmake/Config.cmake.in | 1 + code/CMakeLists.txt | 1 + 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be8a1f5f24..1098bd3128 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,20 +131,25 @@ IF ( ASSIMP_ENABLE_BOOST_WORKAROUND ) ADD_DEFINITIONS( -DASSIMP_BUILD_BOOST_WORKAROUND ) MESSAGE( STATUS "Building a non-boost version of Assimp." ) ELSE ( ASSIMP_ENABLE_BOOST_WORKAROUND ) - SET( Boost_DETAILED_FAILURE_MSG ON ) - IF ( NOT Boost_ADDITIONAL_VERSIONS ) - SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" "1.58" "1.58.0" "1.59" "1.59.0") - ENDIF ( NOT Boost_ADDITIONAL_VERSIONS ) - FIND_PACKAGE( Boost ) - IF ( NOT Boost_FOUND ) - MESSAGE( FATAL_ERROR - "Boost libraries (http://www.boost.org/) not found. " - "You can build a non-boost version of Assimp with slightly reduced " - "functionality by specifying -DASSIMP_ENABLE_BOOST_WORKAROUND=ON." - ) - ENDIF ( NOT Boost_FOUND ) + if(HUNTER_ENABLED) + hunter_add_package(Boost) + find_package(Boost CONFIG REQUIRED) + else() + SET( Boost_DETAILED_FAILURE_MSG ON ) + IF ( NOT Boost_ADDITIONAL_VERSIONS ) + SET( Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0" "1.48.0" "1.48" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52.0" "1.53.0" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" "1.58" "1.58.0" "1.59" "1.59.0") + ENDIF ( NOT Boost_ADDITIONAL_VERSIONS ) + FIND_PACKAGE( Boost ) + IF ( NOT Boost_FOUND ) + MESSAGE( FATAL_ERROR + "Boost libraries (http://www.boost.org/) not found. " + "You can build a non-boost version of Assimp with slightly reduced " + "functionality by specifying -DASSIMP_ENABLE_BOOST_WORKAROUND=ON." + ) + ENDIF ( NOT Boost_FOUND ) - INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) + INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) + endif() ENDIF ( ASSIMP_ENABLE_BOOST_WORKAROUND ) FIND_PACKAGE( DirectX ) diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in index 58a8e7ba0d..554ee9427f 100644 --- a/cmake/Config.cmake.in +++ b/cmake/Config.cmake.in @@ -1,5 +1,6 @@ @PACKAGE_INIT@ +find_package(Boost CONFIG REQUIRED) find_package(ZLIB CONFIG REQUIRED) find_package(convertutf CONFIG REQUIRED) find_package(irrXML CONFIG REQUIRED) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 350ff91674..00e31b540a 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -744,6 +744,7 @@ TARGET_LINK_LIBRARIES( poly2tri::poly2tri minizip::minizip ZLIB::zlib + Boost::boost ) target_compile_definitions(assimp PUBLIC ASSIMP_BUILD_NO_OWN_ZLIB)