From a7ffef3e90471d8d71bfff6f2208a6025f8bdb3a Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Mon, 15 Apr 2013 12:45:02 +0200 Subject: [PATCH] Shared boost libraries are now searched for by default. To search for static boost libs configure with Boost_USE_STATIC_LIBS=ON from the command line or as a parameter to ccmake. --- CMakeLists.txt | 2 ++ scripts/cmake/ExternalProjectBoost.cmake | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16e29c604e9..1edd370bb5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,9 @@ ENDIF() #OGS_PACKAGING ###################### # External projects +OPTION(Boost_USE_STATIC_LIBS "This option has to be set from the command line (before boost gets found)!" OFF) INCLUDE(scripts/cmake/ExternalProjectBoost.cmake) +INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) # Add subdirectories with the projects ADD_SUBDIRECTORY( ThirdParty ) diff --git a/scripts/cmake/ExternalProjectBoost.cmake b/scripts/cmake/ExternalProjectBoost.cmake index 484d8bdb8db..06b5751583a 100644 --- a/scripts/cmake/ExternalProjectBoost.cmake +++ b/scripts/cmake/ExternalProjectBoost.cmake @@ -26,9 +26,12 @@ SET(BOOST_LIBS_TO_BUILD # wave ) +IF(Boost_FOUND) + RETURN() +ENDIF() + # First check for system boost IF(NOT Boost_INCLUDE_DIRS) - SET(Boost_USE_STATIC_LIBS ON) IF(OGS_LIBS_DIR) SET(BOOST_ROOT ${OGS_LIBS_DIR}/boost) ENDIF() @@ -36,12 +39,9 @@ IF(NOT Boost_INCLUDE_DIRS) SET(BOOST_ROOT /opt/boxen/homebrew) ENDIF() FIND_PACKAGE(Boost 1.46.0 COMPONENTS ${BOOST_LIBS_TO_BUILD}) - IF(NOT Boost_FOUND) - SET(Boost_USE_STATIC_LIBS OFF) - FIND_PACKAGE(Boost 1.46.0 COMPONENTS ${BOOST_LIBS_TO_BUILD}) - ENDIF() IF(Boost_FOUND) - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + SET(Boost_FOUND TRUE CACHE BOOL "Was Boost found?" FORCE) + SET(Boost_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}" CACHE STRING "Boost include dirs" FORCE) RETURN() ELSE() SET(Boost_INCLUDE_DIRS "") @@ -126,5 +126,4 @@ IF(NOT Boost_INCLUDE_DIRS) MESSAGE(STATUS "Building Boost automatically.") ENDIF() -INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} ) LINK_DIRECTORIES( ${source_dir}/stage/lib/ ) -- GitLab