]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Clean up configure_boost.cmake and simplify detection logic
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 22 Dec 2013 15:30:55 +0000 (15:30 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 22 Dec 2013 15:30:55 +0000 (15:30 +0000)
git-svn-id: https://svn.dealii.org/trunk@32095 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_boost.cmake

index a3efb533e52c7b7fb9ffca46047ae4c06a676501..31983ddcee0328e26587994f22f08beec87912ce 100644 (file)
@@ -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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.