Skip to content

Commit 3019ea7

Browse files
committed
enabling Boost in CMake and include it for example
to use Boost headers just include '3rdparty_INCLUDES' Signed-off-by: Torbjörn Klatt <[email protected]>
1 parent b5f9d3e commit 3019ea7

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

3rdparty/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ set(3rdparty_INCLUDES ${3rdparty_INCLUDES})
33
set(3rdparty_DEPENDEND_LIBS ${3rdparty_DEPENDEND_LIBS})
44
message(STATUS "--------------------------------------------------------------------------------")
55

6+
message(STATUS "Boost")
7+
8+
if(pfasst_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
9+
set(Boost_USE_STATIC_LIBS OFF)
10+
set(pfasst_BUILD_SHARED_LIBS ON)
11+
set(BUILD_SHARED_LIBS ON)
12+
else()
13+
set(Boost_USE_STATIC_LIBS ON)
14+
set(pfasst_BUILD_SHARED_LIBS OFF)
15+
set(BUILD_SHARED_LIBS OFF)
16+
endif()
17+
set(Boost_USE_MULTITHREADED ON)
18+
19+
find_package(Boost REQUIRED)
20+
list(APPEND 3rdparty_INCLUDES ${Boost_INCLUDE_DIRS})
21+
22+
623
if(pfasst_BUILD_EXAMPLES)
724
message(STATUS "FFTW3")
825
set(fftw3_SOURCE_DIR "${pfasst_BINARY_DIR}/3rdparty/src/fftw3")

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ message(STATUS "Configuring 3rd party libraries")
6666
# makes available:
6767
# - fftw3_INCLUDES (if pfasst_BUILD_EXAMPLES)
6868
# - fftw3_LIBS (if pfasst_BUILD_EXAMPLES)
69+
# and Boost headers in 3rdparty_INCLUDES
6970
add_subdirectory(3rdparty)
7071

7172
message(STATUS "********************************************************************************")

examples/advection_diffusion/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
message(STATUS " advection_diffusion")
22
include_directories(
3+
${3rdparty_INCLUDES}
34
${fftw3_INCLUDES}
45
${pfasst_INCLUDES}
56
)

0 commit comments

Comments
 (0)