# General configuration options:
#
-OPTION(DEAL_II_USE_CONTRIB
- "Build and use contrib libraries bundled with the source tarball."
- ON
- )
+OPTION(DEAL_II_ALLOW_CONTRIB
+ "Allow the use of contrib libraries bundled with the source tarball.
+ Note: If set to off DEAL_II_FORCE_CONTRIB* will still pull in bundled
+ packages, so to ensure that only external libraries are used
+ DEAL_II_ALLOW_CONTRIB as well as all DEAL_II_FORCE_CONTRIB_* have to be
+ OFF"
+ ON)
+
OPTION(DEAL_II_WITH_THREADS
"Build deal.II with support for threads. This pulls in libtbb as a dependency."
- ON
- )
+ ON)
+
OPTION(DEAL_II_FUNCTIONPARSER
- "BUild deal.II with support for functionparser"
- ON
- )
-OPTION(DEAL_II_MPI "Build deal.II with support for openmpi."
- OFF
- )
-OPTION(DEAL_II_WITH_UMFPACK "Build deal.II with support for UMFPACK, BLAS and LAPACK."
- ON
- )
-OPTION(DEAL_II_WITH_METIS "Build deal.II with support for Metis."
- OFF
- )
+ "Build deal.II with support for functionparser"
+ ON)
+
+OPTION(DEAL_II_MPI
+ "Build deal.II with support for openmpi."
+ OFF)
+
+OPTION(DEAL_II_WITH_UMFPACK
+ "Build deal.II with support for UMFPACK, BLAS and LAPACK."
+ ON)
+
+OPTION(DEAL_II_WITH_METIS
+ "Build deal.II with support for Metis."
+ OFF)
# TODO: The rest ;-)
+OPTION(DEAL_II_FORCE_CONTRIB_BOOST
+ "Always use the bundled boost library instead of an external one."
+ OFF)
+
+OPTION(DEAL_II_FORCE_CONTRIB_TBB
+ "Always use the bundled tbb library instead of an external one."
+ OFF)
+
+OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK
+ "Always use the bundled umfpack library instead of an external one."
+ OFF)
+
#
# Now, configure and prepare a lot of things:
# TODO: The rest...
-message( "${deal_ii_external_libraries}" )
+
#
# Build the toolchain:
ADD_SUBDIRECTORY(common/expand_instantiations)
-
#
# Compile the library:
#
INCLUDE(macro_expand_instantiations)
ADD_SUBDIRECTORY(include)
+
ADD_SUBDIRECTORY(source)
-IF(NOT DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+ FIND_PACKAGE (Boost COMPONENTS serialization thread)
+ELSE()
FIND_PACKAGE (Boost COMPONENTS serialization thread REQUIRED)
+ENDIF()
+
+#
+# Get rid of this annoying unimportant variable:
+#
+MARK_AS_ADVANCED(Boost_DIR)
- INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
+IF(NOT DEAL_II_FORCE_CONTRIB_BOOST)
+ IF(Boost_THREAD_FOUND AND Boost_SERIALIZATION_FOUND)
+ INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
- LIST(APPEND deal_ii_external_libraries
- ${Boost_THREAD_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
- )
- LIST(APPEND deal_ii_external_debug_libraries
- ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG}
- )
+ LIST(APPEND deal_ii_external_libraries
+ ${Boost_THREAD_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
+ )
+ LIST(APPEND deal_ii_external_debug_libraries
+ ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_SERIALIZATION_LIBRARY_DEBUG}
+ )
- SET(DEAL_II_USE_EXTERNAL_BOOST TRUE)
+ SET(DEAL_II_USE_EXTERNAL_BOOST TRUE)
+ ENDIF()
ENDIF()
FIND_PACKAGE(Threads REQUIRED)
-IF(DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+ FIND_PACKAGE(TBB)
+ELSE()
+ FIND_PACKAGE(TBB REQUIRED)
+ENDIF()
+
+IF(DEAL_II_FORCE_CONTRIB_TBB OR NOT TBB_FOUND)
+ SET(libtbb_directory "tbb30_104oss")
+
# compile and link the contrib tbb library:
ADD_SUBDIRECTORY(contrib/tbb)
- # This sets TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
- # _installed_ library location
-ELSE()
+ # set TBB_LIBRARY and TBB_DEBUG_LIBRARY to the full path of the
+ # _installed_ library location:
- FIND_PACKAGE(TBB REQUIRED)
+ SET(TBB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/contrib/tbb/${libtbb_directory}/include)
+ SET(TBB_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb.so)
+ SET(TBB_DEBUG_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb_debug.so)
ENDIF()
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
-IF(NOT DEAL_II_USE_CONTRIB)
- LIST(APPEND deal_ii_include_paths
- ${TBB_INCLUDE_DIR}
- )
-ENDIF()
-
LIST(APPEND deal_ii_external_libraries
${TBB_LIBRARY}
)
FIND_PACKAGE(LAPACK REQUIRED)
FIND_PACKAGE(BLAS REQUIRED)
-IF(DEAL_II_USE_CONTRIB)
+IF(DEAL_II_ALLOW_CONTRIB)
+ FIND_PACKAGE(Umfpack)
+ FIND_PACKAGE(AMD)
+ELSE()
+ FIND_PACKAGE(Umfpack REQUIRED)
+ FIND_PACKAGE(AMD REQUIRED)
+ENDIF()
+
+IF(UMFPACK_FOUND AND AMD_FOUND)
+ SET(UmfpackAMD_FOUND TRUE)
+ELSE()
+ SET(UmfpackAMD_FOUND FALSE)
+ENDIF()
+
+
+IF(DEAL_II_FORCE_CONTRIB_UMFPACK OR NOT UmfpackAMD_FOUND)
#
# Add umfpack and amd directly to the object files of deal.II
#
$<TARGET_OBJECTS:obj_amd_global>
)
ELSE()
- FIND_PACKAGE(Umfpack REQUIRED)
- FIND_PACKAGE(AMD REQUIRED)
INCLUDE_DIRECTORIES(${Umfpack_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
- #
- # We skip *_INCLUDE_DIR because it is not needed for the use of the
- # deal.II library
- #
-
LIST(APPEND deal_ii_external_libraries
${Umfpack_LIBRARY} ${AMD_LIBRARY} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)
-SET(libtbb_directory "tbb30_104oss")
-
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${libtbb_directory}
COMMAND ${CMAKE_COMMAND} -E copy_directory
ADD_DEPENDENCIES(deal_ii_target_dependencies tbb)
-SET(TBB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${libtbb_directory}/include)
-SET(TBB_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb.so)
-SET(TBB_DEBUG_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/libtbb_debug.so)
-
INSTALL(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${libtbb_directory}/include/tbb
DESTINATION include