From: Matthias Maier Date: Wed, 25 Apr 2018 20:23:17 +0000 (-0500) Subject: CMake: Let FindADOLC.cmake check whether adolc uses Boost pool allocator X-Git-Tag: v9.0.0-rc1~103^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43f71232eb2c5f3de50d526a24b4391b223980e5;p=dealii.git CMake: Let FindADOLC.cmake check whether adolc uses Boost pool allocator Let the find module check whether adolc uses the Boost pool allocator. If yes, add all boost libraries to the link interface. --- diff --git a/cmake/modules/FindADOLC.cmake b/cmake/modules/FindADOLC.cmake index a178b738ba..6702e403e8 100644 --- a/cmake/modules/FindADOLC.cmake +++ b/cmake/modules/FindADOLC.cmake @@ -22,8 +22,9 @@ # # ADOLC_INCLUDE_DIR # ADOLC_LIBRARY -# ADOLC_WITH_ATRIG_ERF # ADOLC_WITH_ADVANCED_BRANCHING +# ADOLC_WITH_ATRIG_ERF +# ADOLC_WITH_BOOST_ALLOCATOR # SET(ADOLC_DIR "" CACHE PATH "An optional hint to an ADOL-C installation") @@ -75,11 +76,27 @@ IF(EXISTS ${ADOLC_SETTINGS_H}) ELSE() SET(ADOLC_WITH_ADVANCED_BRANCHING FALSE) ENDIF() + + # + # Check whether ADOL-C is configured to use the Boost pool allocator + # + FILE(STRINGS "${ADOLC_SETTINGS_H}" ADOLC_BOOST_POOL_STRING + REGEX "#define USE_BOOST_POOL" + ) + IF(NOT "${ADOLC_BOOST_POOL_STRING}" STREQUAL "") + SET(ADOLC_WITH_BOOST_ALLOCATOR TRUE) + SET(_additional_library OPTIONAL BOOST_LIBRARIES) + ELSE() + SET(ADOLC_WITH_BOOST_ALLOCATOR FALSE) + SET(_additional_library) + ENDIF() ENDIF() DEAL_II_PACKAGE_HANDLE(ADOLC - LIBRARIES REQUIRED ADOLC_LIBRARY + LIBRARIES + REQUIRED ADOLC_LIBRARY + ${_additional_library} INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR USER_INCLUDE_DIRS REQUIRED ADOLC_INCLUDE_DIR CLEAR ADOLC_INCLUDE_DIR ADOLC_LIBRARY ADOLC_SETTINGS_H