From 14fa929feeec34fb4a723d1064cef653b94f1469 Mon Sep 17 00:00:00 2001 From: maier Date: Sun, 22 Dec 2013 15:30:55 +0000 Subject: [PATCH] CMake: Clean up configure_boost.cmake and simplify detection logic git-svn-id: https://svn.dealii.org/trunk@32095 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/configure/configure_boost.cmake | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/deal.II/cmake/configure/configure_boost.cmake b/deal.II/cmake/configure/configure_boost.cmake index a3efb533e5..31983ddcee 100644 --- a/deal.II/cmake/configure/configure_boost.cmake +++ b/deal.II/cmake/configure/configure_boost.cmake @@ -38,11 +38,16 @@ SET(DEAL_II_WITH_BOOST ON # Always true. We need it :-] MACRO(FEATURE_BOOST_FIND_EXTERNAL var) + # + # This mumbo jumbo is necessary because CMake won't let us test against + # BOOST_DIR directly. WTF?! + # IF(NOT DEFINED BOOST_DIR) SET(BOOST_DIR "$ENV{BOOST_DIR}") ELSE() SET_IF_EMPTY(BOOST_DIR "$ENV{BOOST_DIR}") ENDIF() + IF(NOT "${BOOST_DIR}" STREQUAL "") SET(BOOST_ROOT "${BOOST_DIR}") ENDIF() @@ -65,20 +70,14 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) # # Fall back to dynamic libraries if no static libraries could be found: # - IF( Boost_USE_STATIC_LIBS AND - (NOT Boost_SERIALIZATION_FOUND OR NOT Boost_SYSTEM_FOUND) - ) + IF(NOT Boost_FOUND AND Boost_USE_STATIC_LIBS) SET(Boost_USE_STATIC_LIBS FALSE) FIND_PACKAGE(Boost 1.44 COMPONENTS ${_boost_components}) ENDIF() MARK_AS_ADVANCED(Boost_DIR) - - IF( Boost_SERIALIZATION_FOUND AND - Boost_SYSTEM_FOUND AND - (NOT DEAL_II_WITH_THREADS OR Boost_THREAD_FOUND) ) - + IF(Boost_FOUND) SET(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}") SET(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}") SET(BOOST_VERSION_SUBMINOR "${Boost_SUBMINOR_VERSION}") @@ -101,9 +100,7 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var) ELSE() - SET(BOOST_DIR "" CACHE PATH - "An optional hint to a boost directory" - ) + SET(BOOST_DIR "" CACHE PATH "An optional hint to a boost directory") ENDIF() ENDMACRO() @@ -119,12 +116,8 @@ MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED) # We need to set some definitions to use the headers of the bundled boost # library: # - LIST(APPEND DEAL_II_DEFINITIONS - "BOOST_NO_HASH" "BOOST_NO_SLIST" - ) - LIST(APPEND DEAL_II_USER_DEFINITIONS - "BOOST_NO_HASH" "BOOST_NO_SLIST" - ) + LIST(APPEND DEAL_II_DEFINITIONS "BOOST_NO_HASH" "BOOST_NO_SLIST") + LIST(APPEND DEAL_II_USER_DEFINITIONS "BOOST_NO_HASH" "BOOST_NO_SLIST") INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include) ENDMACRO() -- 2.39.5