From 633d512d1b5dc8e0ab678527ca69c5d847bcad11 Mon Sep 17 00:00:00 2001 From: Pascal Jungblut Date: Thu, 7 Mar 2019 14:56:12 +0100 Subject: [PATCH] Add Boost as a dependency So far this will only add the include directory to the library as well as to the compiler wrapper. If at some point some Boost module must be linked, it should be added to Boost.cmake. --- CMakeExt/Boost.cmake | 5 +++++ CMakeLists.txt | 1 + dash/CMakeLists.txt | 9 +++++++++ 3 files changed, 15 insertions(+) create mode 100644 CMakeExt/Boost.cmake diff --git a/CMakeExt/Boost.cmake b/CMakeExt/Boost.cmake new file mode 100644 index 000000000..3e7a33656 --- /dev/null +++ b/CMakeExt/Boost.cmake @@ -0,0 +1,5 @@ +find_package(Boost REQUIRED COMPONENTS + ## If you need to link a boost library, add it below. For example: + # chrono + ## will link boost_chrono for you and also add it as a dependency. + ) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc53c27be..8771d6e22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,7 @@ endif() # Load build modules to locate libraries after environment setup # has been loaded: +include(${CMAKE_SOURCE_DIR}/CMakeExt/Boost.cmake) include(${CMAKE_SOURCE_DIR}/CMakeExt/MPI.cmake) include(${CMAKE_SOURCE_DIR}/CMakeExt/PAPI.cmake) include(${CMAKE_SOURCE_DIR}/CMakeExt/Hwloc.cmake) diff --git a/dash/CMakeLists.txt b/dash/CMakeLists.txt index b3d41d497..44915e248 100644 --- a/dash/CMakeLists.txt +++ b/dash/CMakeLists.txt @@ -231,6 +231,10 @@ if (ENABLE_SCALAPACK) ${SCALAPACK_LIBRARIES}) endif() endif() +set (ADDITIONAL_INCLUDES ${ADDITIONAL_INCLUDES} + ${Boost_INCLUDE_DIRS}) +set (ADDITIONAL_LIBRARIES ${ADDITIONAL_LIBRARIES} + ${Boost_LIBRARIES}) if (HAVE_STD_TRIVIALLY_COPYABLE) set (ADDITIONAL_COMPILE_FLAGS @@ -352,6 +356,11 @@ foreach (dart_variant ${DART_IMPLEMENTATIONS_LIST}) #cotire(${DASH_LIBRARY}) endif() + include_directories(${Boost_INCLUDE_DIR}) + target_link_libraries( + ${DASH_LIBRARY} + ${Boost_LIBRARIES}) + include_directories( ${ADDITIONAL_INCLUDES} )