Skip to content
Snippets Groups Projects
Commit 7505efeb authored by Markus Blatt's avatar Markus Blatt
Browse files

Fix FS#1312, Merge branch 'feature/workaround-redhat-boost-problem' into releases/2.2-cmake

parents 70120311 ef2576e5
Branches
Tags
No related merge requests found
# Searches for boost and provides the following function:
#
# add_dune_boost_flags(targets)
# add_dune_boost_flags(targets [LINK_ALL_BOOST_LIBRARIES]
# LIBRARIES lib1 lib2 ...)
#
# Adds boost compiler flags and libraries, and activates
# Boost for the specified targets.
# Boost for the specified targets. Libraries can either be
# provided by listing them after the LIBRARIES keyword or one
# can request linking with all available boost libraries by
# passing the LINK_ALL_BOOST_LIBRARIES option to the function
# call.
find_package(Boost)
set(HAVE_DUNE_BOOST ${Boost_FOUND})
function(add_dune_boost_flags _targets)
cmake_parse_arguments(DUNE_BOOST LINK_ALL_BOOST_LIBRARIES "" LIBRARIES ${ARGN})
if(Boost_FOUND)
include_directories("${Boost_INCLUDE_DIRS}")
foreach(_target ${_targets})
target_link_libraries(${_target} ${Boost_LIBRARIES})
if(DUNE_BOOST_LINK_ALL_BOOST_LIBRARIES)
target_link_libraries(${_target} "${DUNE_Boost_LIBRARIES}")
else(DUNE_BOOST_LINK_ALL_BOOST_LIBRARIES)
target_link_libraries(${_target} "${DUNE_BOOST_LIBRARIES}")
endif(DUNE_BOOST_LINK_ALL_BOOST_LIBRARIES)
# The definitions are a hack as we do not seem to know which MPI implementation was
# found.
GET_TARGET_PROPERTY(_props ${_target} COMPILE_FLAGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment