ENDMACRO()
-
MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL)
- ADD_FLAGS(DEAL_II_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
- DEAL_II_APPEND_LIBRARIES(${LAPACK_LIBRARIES})
-
+ REGISTER_FEATURE(LAPACK)
CHECK_FOR_LAPACK_FUNCTIONS()
ENDMACRO()
MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL)
- ADD_FLAGS(CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
- ADD_FLAGS(DEAL_II_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
-
- DEAL_II_APPEND_LIBRARIES(${MPI_CXX_LIBRARIES})
- INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
-
+ #
# The user has to know the location of the mpi headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})
+ #
+ SET(MPI_CXX_ADD_TO_USER_INCLUDE_DIRS TRUE)
+
+ REGISTER_FEATURE(MPI_CXX)
ENDMACRO()
MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
- DEAL_II_APPEND_LIBRARIES(${TBB_LIBRARIES})
+ REGISTER_FEATURE(TBB)
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
IF(TBB_WITH_DEBUG_LIB)
"TBB_USE_DEBUG=1" "TBB_DO_ASSERT=1"
)
ENDIF()
-
ENDIF()
#
MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${TRILINOS_INCLUDE_DIRS})
-
- # The user has to know the location of the trilinos headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS})
-
- DEAL_II_APPEND_LIBRARIES(${TRILINOS_LIBRARIES})
+ SET(TRILINOS_ADD_TO_USER_INCLUDE_DIRS TRUE)
+ REGISTER_FEATURE(TRILINOS)
SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector")
SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector")
MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL)
INCLUDE_DIRECTORIES(${PETSC_INCLUDE_DIRS})
- # The user has to know the location of the petsc headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS})
-
- DEAL_II_APPEND_LIBRARIES(${PETSC_LIBRARIES})
+ SET(PETSC_ADD_TO_USER_INCLUDE_DIRS TRUE)
+ REGISTER_FEATURE(PETSC)
#
# Disable a bunch of warnings when compiling with petsc:
MARK_AS_ADVANCED(Boost_DIR)
- SET(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}")
- SET(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}")
- SET(BOOST_VERSION_SUBMINOR "${Boost_SUBMINOR_VERSION}")
- SET(BOOST_VERSION
- "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}"
- )
-
IF( Boost_SERIALIZATION_FOUND AND
Boost_SYSTEM_FOUND AND
- (NOT DEAL_II_WITH_THREADS OR Boost_THREAD_FOUND)
- )
+ (NOT DEAL_II_WITH_THREADS OR Boost_THREAD_FOUND) )
+
+ SET(BOOST_VERSION_MAJOR "${Boost_MAJOR_VERSION}")
+ SET(BOOST_VERSION_MINOR "${Boost_MINOR_VERSION}")
+ SET(BOOST_VERSION_SUBMINOR "${Boost_SUBMINOR_VERSION}")
+ SET(BOOST_VERSION
+ "${BOOST_VERSION_MAJOR}.${BOOST_VERSION_MINOR}.${BOOST_VERSION_SUBMINOR}"
+ )
+
+ #
+ # Remove "pthread" from Boost_LIBRARIES. Threading, if necessary, is
+ # already set up via configure_1_threads.cmake.
+ #
+ LIST(REMOVE_ITEM Boost_LIBRARIES "pthread")
+
+ SET(BOOST_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
+ SET(BOOST_LIBRARIES ${Boost_LIBRARIES})
+
MARK_AS_ADVANCED(BOOST_DIR)
+
SET(${var} TRUE)
+
ELSE()
+
SET(BOOST_DIR "" CACHE PATH
"An optional hint to a boost directory"
)
ENDMACRO()
-MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
-
- # The user has to know the location of the boost headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
-
- #
- # Remove "pthread" from Boost_LIBRARIES. Threading, if necessary, is
- # already set up via configure_1_threads.cmake.
- #
- LIST(REMOVE_ITEM Boost_LIBRARIES "pthread")
-
- DEAL_II_APPEND_LIBRARIES(${Boost_LIBRARIES})
-
-ENDMACRO()
+#
+# The user has to know the location of the boost headers as well:
+#
+SET(BOOST_ADD_TO_USER_INCLUDE_DIRS TRUE)
MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED)
ENDMACRO()
-MACRO(FEATURE_HDF5_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
-
- # The user has to know the location of the HDF5 headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
-
- DEAL_II_APPEND_LIBRARIES(${HDF5_LIBRARIES})
-ENDMACRO()
+#
+# The user has to know the location of the hdf5 headers as well:
+#
+SET(HDF5_ADD_TO_USER_INCLUDE_DIRS TRUE)
CONFIGURE_FEATURE(HDF5)
SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI DEAL_II_WITH_LAPACK)
-MACRO(FEATURE_MUMPS_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${MUMPS_INCLUDE_DIRS})
- # The user has to know the location of the MUMPS headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MUMPS_INCLUDE_DIRS})
+#
+# The user has to know the location of the MUMPS headers as well:
+#
+SET(MUMPS_ADD_TO_USER_INCLUDE_DIRS TRUE)
- DEAL_II_APPEND_LIBRARIES(${MUMPS_LIBRARIES})
-ENDMACRO()
CONFIGURE_FEATURE(MUMPS)
ENDMACRO()
-MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIRS})
-
- # The user has to know the location of the P4EST headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIRS})
+#
+# The user has to know the location of the P4est headers as well:
+#
+SET(P4EST_ADD_TO_USER_INCLUDE_DIRS TRUE)
- DEAL_II_APPEND_LIBRARIES(${P4EST_LIBRARIES})
-ENDMACRO()
CONFIGURE_FEATURE(P4EST)
ENDIF()
ENDMACRO()
-MACRO(FEATURE_SLEPC_CONFIGURE_EXTERNAL)
- INCLUDE_DIRECTORIES(${SLEPC_INCLUDE_DIRS})
- # The user has to know the location of the SLEPC headers as well:
- LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${SLEPC_INCLUDE_DIRS})
-
- DEAL_II_APPEND_LIBRARIES(${SLEPC_LIBRARIES})
-ENDMACRO()
+#
+# The user has to know the location of the SLEPC headers as well:
+#
+SET(SLEPC_ADD_TO_USER_INCLUDE_DIRS TRUE)
MACRO(FEATURE_SLEPC_ERROR_MESSAGE)
ENDMACRO()
-#
-# Default macro for basic external setup:
-#
-MACRO(FEATURE_CONFIGURE_EXTERNAL _feature)
- IF(DEFINED ${_feature}_INCLUDE_DIRS)
- INCLUDE_DIRECTORIES(${${_feature}_INCLUDE_DIRS})
- ENDIF()
- IF(DEFINED ${_feature}_LIBRARIES)
- DEAL_II_APPEND_LIBRARIES(${${_feature}_LIBRARIES})
- ENDIF()
- IF(DEFINED ${_feature}_LINKER_FLAGS)
- ADD_FLAGS(DEAL_II_LINKER_FLAGS "${${_feature}_LINKER_FLAGS}")
- ENDIF()
-ENDMACRO()
-
-
########################################################################
# #
# CONFIGURE_FEATURE: #
IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL)
RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()")
ELSE()
- FEATURE_CONFIGURE_EXTERNAL(${_feature})
+ REGISTER_FEATURE(${_feature})
ENDIF()
MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
+++ /dev/null
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2013 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-#
-# A small macro to add libraries to
-# DEAL_II_EXTERNAL_LIBRARIES
-# DEAL_II_EXTERNAL_LIBRARIES_DEBUG
-# DEAL_II_EXTERNAL_LIBRARIES_RELEASE
-# depending on the "optmized", "debug" or "general" keyword
-#
-# Usage:
-# DEAL_II_APPEND_LIBRARIES(<list of libraries>)
-#
-
-MACRO(DEAL_II_APPEND_LIBRARIES)
-
- SET(_toggle "general")
- FOREACH(_tmp ${ARGN})
- IF( "${_tmp}" STREQUAL "debug" OR
- "${_tmp}" STREQUAL "optimized" OR
- "${_tmp}" STREQUAL "general" )
- SET(_toggle "${_tmp}")
- ELSE()
- IF("${_toggle}" STREQUAL "general")
- LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${_tmp})
- ELSEIF("${_toggle}" STREQUAL "debug")
- LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_tmp})
- ELSEIF("${_toggle}" STREQUAL "optimized")
- LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_tmp})
- ENDIF()
- ENDIF()
- ENDFOREACH()
-
-ENDMACRO()
--- /dev/null
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2013 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE at
+## the top level of the deal.II distribution.
+##
+## ---------------------------------------------------------------------
+
+#
+# This macro is used for the feature configuration in deal.II
+#
+# Usage:
+# REGISTER_FEATURE(feature)
+#
+# This macro will
+#
+# - add ${feature}_INCLUDE_DIRS and ${feature}_INCLUDE_PATH
+# to the list of (internal) include
+# directories
+# - and if ${feature}_ADD_TO_USER_INCLUDE_DIRS is defined also to
+# DEAL_II_USER_INCLUDE_DIRS
+#
+# - add ${feature}_LINKER_FLAGS and ${feature}_LINK_FLAGS to
+# DEAL_II_LINKER_FLAGS
+#
+# - add ${feature}_CXX_FLAGS and ${feature}_COMPILE_FLAGS to
+# CMAKE_CXX_FLAGS
+#
+# - add ${feature}_LIBRARIES to the list of deal.II libraries depending
+# on general, optimized or debug keyword
+#
+
+
+MACRO(REGISTER_FEATURE _feature)
+ MESSAGE(STATUS "Register enabled external feature ${_feature}:")
+
+ # variables for include directories:
+ FOREACH(_var ${_feature}_INCLUDE_DIRS ${_feature}_INCLUDE_PATH)
+ IF(DEFINED ${_var})
+ MESSAGE(STATUS " ${_var}")
+ INCLUDE_DIRECTORIES(${${_var}})
+ IF(${_feature}_ADD_TO_USER_INCLUDE_DIRS)
+ LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${${_var}})
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+
+ # variables for linker flags:
+ FOREACH(_var ${_feature}_LINKER_FLAGS ${_feature}_LINK_FLAGS)
+ IF(DEFINED ${_var})
+ MESSAGE(STATUS " ${_var}")
+ ADD_FLAGS(DEAL_II_LINKER_FLAGS "${${_var}}")
+ ENDIF()
+ ENDFOREACH()
+
+ # variables for compiler flags:
+ FOREACH(_var ${_feature}_CXX_FLAGS ${_feature}_COMPILE_FLAGS)
+ IF(DEFINED ${_var})
+ MESSAGE(STATUS " ${_var}")
+ ADD_FLAGS(CMAKE_CXX_FLAGS "${${_var}}")
+ ENDIF()
+ ENDFOREACH()
+
+ IF(DEFINED ${_feature}_LIBRARIES)
+ MESSAGE(STATUS " ${_feature}_LIBRARIES")
+ #
+ # Add ${_feature}_LIBRARIES to
+ # DEAL_II_EXTERNAL_LIBRARIES
+ # DEAL_II_EXTERNAL_LIBRARIES_DEBUG
+ # DEAL_II_EXTERNAL_LIBRARIES_RELEASE
+ # depending on the "optmized", "debug" or "general" keyword
+ #
+ SET(_toggle "general")
+ FOREACH(_tmp ${${_feature}_LIBRARIES})
+ IF( "${_tmp}" STREQUAL "debug" OR
+ "${_tmp}" STREQUAL "optimized" OR
+ "${_tmp}" STREQUAL "general" )
+ SET(_toggle "${_tmp}")
+ ELSE()
+ IF("${_toggle}" STREQUAL "general")
+ LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${_tmp})
+ ELSEIF("${_toggle}" STREQUAL "debug")
+ LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_DEBUG ${_tmp})
+ ELSEIF("${_toggle}" STREQUAL "optimized")
+ LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES_RELEASE ${_tmp})
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+ ENDIF()
+
+ENDMACRO()