]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Big configuration cleanup part2
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 28 Feb 2013 00:03:56 +0000 (00:03 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 28 Feb 2013 00:03:56 +0000 (00:03 +0000)
Simplify the feature configuration

git-svn-id: https://svn.dealii.org/branches/branch_cmake@28628 0785d39b-7218-0410-832d-ea1e28bc413d

18 files changed:
deal.II/cmake/configure/configure_1_mpi.cmake
deal.II/cmake/configure/configure_1_threads.cmake
deal.II/cmake/configure/configure_arpack.cmake
deal.II/cmake/configure/configure_boost.cmake
deal.II/cmake/configure/configure_functionparser.cmake
deal.II/cmake/configure/configure_hdf5.cmake
deal.II/cmake/configure/configure_lapack.cmake
deal.II/cmake/configure/configure_metis.cmake
deal.II/cmake/configure/configure_mumps.cmake
deal.II/cmake/configure/configure_netcdf.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/configure/configure_petsc.cmake
deal.II/cmake/configure/configure_slepc.cmake
deal.II/cmake/configure/configure_trilinos.cmake
deal.II/cmake/configure/configure_umfpack.cmake
deal.II/cmake/configure/configure_zlib.cmake
deal.II/cmake/macros/macro_configure_feature.cmake
deal.II/cmake/modules/FindMUMPS.cmake

index 75def06523d12ff6f057307ddf5afdec02186cc1..e54cdb867b834d12344f05e9d827b011bbbc9b4d 100644 (file)
@@ -16,7 +16,6 @@
 # Configuration for mpi support:
 #
 
-
 MACRO(FEATURE_MPI_FIND_EXTERNAL var)
   FIND_PACKAGE(MPI QUIET)
 
@@ -26,14 +25,12 @@ MACRO(FEATURE_MPI_FIND_EXTERNAL var)
       MPI_EXTRA_LIBRARY
       MPI_LIBRARY
       )
-
     SET(${var} TRUE)
   ENDIF()
 ENDMACRO()
 
 
-MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
-
+MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL)
   ADD_FLAGS(CMAKE_CXX_FLAGS "${MPI_CXX_COMPILE_FLAGS}")
   ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS}")
 
@@ -43,7 +40,7 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
   # The user has to know the location of the mpi headers as well:
   LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})
 
-
+  # TODO:
   SET(DEAL_II_USE_MPICXX ON CACHE BOOL
     "Set the compiler to the detected mpi wrapper ${MPI_CXX_COMPILER}"
     )
@@ -51,8 +48,6 @@ MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
   IF(DEAL_II_MPICXX)
     SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
   ENDIF()
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index a2f26aee9889c12f7b58e5d0e88cfd5216268dbc..5adb1d648c97b7666ca1b574720c07679fd0a886 100644 (file)
 # Set up genereal threading:
 # The macro will be included in CONFIGURE_FEATURE_THREADS_EXTERNAL/BUNDLED.
 #
-MACRO(SETUP_THREADING var)
+MACRO(SETUP_THREADING)
   FIND_PACKAGE(Threads)
 
-  IF(Threads_FOUND)
-    MARK_AS_ADVANCED(
-      pthread_LIBRARY
+  IF(NOT Threads_FOUND)
+    # TODO:
+    MESSAGE(FATAL_ERROR
+      "\nInternal configuration error: No Threading support found\n\n"
       )
-    SET(${var} TRUE)
+  ENDIF()
 
-    #
-    # Change -lphtread to -pthread for better compatibility on non linux
-    # platforms:
-    #
-    IF("${CMAKE_THREAD_LIBS_INIT}" MATCHES "-lpthread")
-      CHECK_CXX_COMPILER_FLAG("-pthread"
-        DEAL_II_HAVE_FLAG_pthread
+  MARK_AS_ADVANCED(pthread_LIBRARY)
+
+  #
+  # Change -lphtread to -pthread for better compatibility on non linux
+  # platforms:
+  #
+  IF("${CMAKE_THREAD_LIBS_INIT}" MATCHES "-lpthread")
+    CHECK_CXX_COMPILER_FLAG("-pthread"
+      DEAL_II_HAVE_FLAG_pthread
+      )
+    IF(DEAL_II_HAVE_FLAG_pthread)
+      STRING(REPLACE "-lpthread" "-pthread" CMAKE_THREAD_LIBS_INIT
+        "${CMAKE_THREAD_LIBS_INIT}"
         )
-      IF(DEAL_II_HAVE_FLAG_pthread)
-        STRING(REPLACE "-lpthread" "-pthread" CMAKE_THREAD_LIBS_INIT
-          "${CMAKE_THREAD_LIBS_INIT}"
-          )
-      ENDIF()
     ENDIF()
+  ENDIF()
 
-    ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
+  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
 
+  #
+  # Set up some posix thread specific configuration toggles:
+  #
+  IF(CMAKE_USE_PTHREADS_INIT)
+    SET(DEAL_II_USE_MT_POSIX TRUE)
 
     #
-    # Set up some posix thread specific configuration toggles:
+    # Check whether posix thread barriers are available:
     #
-    IF(CMAKE_USE_PTHREADS_INIT)
-      SET(DEAL_II_USE_MT_POSIX TRUE)
-
-      #
-      # Check whether posix thread barriers are available:
-      #
-      ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-      CHECK_CXX_SOURCE_COMPILES(
-      "
-      #include <pthread.h>
-      int main()
-      {
-        pthread_barrier_t pb;
-        pthread_barrier_init (&pb, 0, 1);
-        pthread_barrier_wait (&pb);
-        pthread_barrier_destroy (&pb);
-        return 0;
-      }
-      "
-      DEAL_II_HAVE_MT_POSIX_BARRIERS)
-      STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
-      IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS)
-        SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
-      ENDIF()
-
+    ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
+    CHECK_CXX_SOURCE_COMPILES(
+    "
+    #include <pthread.h>
+    int main()
+    {
+      pthread_barrier_t pb;
+      pthread_barrier_init (&pb, 0, 1);
+      pthread_barrier_wait (&pb);
+      pthread_barrier_destroy (&pb);
+      return 0;
+    }
+    "
+    DEAL_II_HAVE_MT_POSIX_BARRIERS)
+    STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
+
+    IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS)
+      SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
     ENDIF()
 
-  ENDIF(Threads_FOUND)
+  ENDIF()
+
 ENDMACRO()
 
 
@@ -98,7 +99,7 @@ MACRO(FEATURE_THREADS_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL var)
+MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL)
   INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
 
   IF (CMAKE_BUILD_TYPE MATCHES "Debug")
@@ -121,16 +122,15 @@ MACRO(FEATURE_THREADS_CONFIGURE_EXTERNAL var)
   ENDIF()
 
   # Setup threading and if successfull return TRUE:
-  SETUP_THREADING(${var})
+  SETUP_THREADING()
 ENDMACRO()
 
 
-MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED var)
+MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED)
   #
   # Setup threading (before configuring our build...)
-  # and if successfull return TRUE:
   #
-  SETUP_THREADING(${var})
+  SETUP_THREADING()
 
   #
   # We have to disable a bunch of warnings:
@@ -157,7 +157,6 @@ MACRO(FEATURE_THREADS_CONFIGURE_BUNDLED var)
   ENDIF()
 
   INCLUDE_DIRECTORIES(${TBB_FOLDER}/include)
-
 ENDMACRO()
 
 
index f7d3226077e7f01169949d8e762eb312d0bfc104..9acaa1c49ff933447de4c0550a71d23fbf4aae06 100644 (file)
 # Configuration for the ARPACK library:
 #
 
-
-MACRO(FEATURE_ARPACK_CONFIGURE_EXTERNAL var)
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${ARPACK_LIBRARIES})
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${ARPACK_LINKER_FLAGS}")
-
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(ARPACK)
index fc1f48436edfda2cff8f20eb1536184461299538..b3548d23b4f055d6884567a6325486d4407f46fe 100644 (file)
@@ -29,9 +29,7 @@ IF(NOT FEATURE_THREADS_PROCESSED)
 ENDIF()
 
 
-SET(DEAL_II_WITH_BOOST
-  # Always true. We need it :-]
-  ON
+SET(DEAL_II_WITH_BOOST ON # Always true. We need it :-]
   CACHE BOOL "Build deal.II with support for boost." FORCE
   )
 
@@ -51,7 +49,7 @@ MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL var)
+MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL)
   INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
 
   IF (CMAKE_BUILD_TYPE MATCHES "Debug")
@@ -65,12 +63,10 @@ MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL var)
       ${Boost_THREAD_LIBRARY_RELEASE} ${Boost_SERIALIZATION_LIBRARY_RELEASE}
       )
   ENDIF()
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
-MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED var)
+MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED)
   #
   # We need to set some definitions to use the headers of the bundled boost
   # library:
@@ -83,8 +79,6 @@ MACRO(FEATURE_BOOST_CONFIGURE_BUNDLED var)
     )
 
   INCLUDE_DIRECTORIES(${BOOST_FOLDER}/include)
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 7facec4607a4b50eb5ba13cdf01adb1223052a4c..e858d3a56887ca6500eadcd6610b3e84e4defff3 100644 (file)
@@ -23,13 +23,8 @@ MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_EXTERNAL var)
-ENDMACRO()
-
-
-MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_BUNDLED var)
+MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_BUNDLED)
   INCLUDE_DIRECTORIES(${FUNCTIONPARSER_FOLDER})
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index daa85919f94fc6fcc5507cb8d97714b55c5a8a49..5895c6c3e7cf6afc55353b373e4b50093d70eda4 100644 (file)
 # Configuration for the netcdf library:
 #
 
-
-MACRO(FEATURE_HDF5_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${HDF5_LIBRARIES})
-
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 MACRO(FEATURE_HDF5_ERROR_MESSAGE)
   MESSAGE(FATAL_ERROR "\n"
     "Could not find the hdf5 library!\n"
@@ -37,5 +28,4 @@ MACRO(FEATURE_HDF5_ERROR_MESSAGE)
     )
 ENDMACRO()
 
-
 CONFIGURE_FEATURE(HDF5)
index 8e68a41b5940fb4b3b2fdf1ece16b5ea54c467f4..1d5bbac3adbe5591a6b0843b8277da37e94cc2e0 100644 (file)
@@ -16,7 +16,6 @@
 # Configuration for the lapack library:
 #
 
-
 MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
   FIND_PACKAGE(LAPACK)
 
@@ -69,16 +68,12 @@ MACRO(RESET_LAPACK_FUNCTIONS_CACHE)
 ENDMACRO()
 
 
-MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
+MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL)
   ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
 
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES
-    ${LAPACK_LIBRARIES}
-    )
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${LAPACK_LIBRARIES})
 
   CHECK_FOR_LAPACK_FUNCTIONS()
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 37a7fefcf284a60d339a7e76f48d6cdeb18784d3..856fd48a75fe8a997b0482ef51d630c41e8a030f 100644 (file)
@@ -37,14 +37,6 @@ MACRO(FEATURE_METIS_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_METIS_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${METIS_LIBRARIES})
-
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 MACRO(FEATURE_METIS_ERROR_MESSAGE)
   MESSAGE(FATAL_ERROR "\n"
     "Could not find the metis library!\n"
index 462779fcb0b1e7ba230cc8f21b5adbe3cb5fb22b..2401ca0ac3b3f2fb98ef78f5daf2d2fcac25ed04 100644 (file)
 # Configuration for the MUMPS library:
 #
 
-
 SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI)
 
 
-MACRO(FEATURE_MUMPS_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${MUMPS_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES
-    ${MUMPS_LIBRARIES}
-    ${MPI_CXX_LIBRARIES} # for good measure
-    )
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${MUMPS_LINKER_FLAGS}")
-
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 MACRO(FEATURE_MUMPS_ERROR_MESSAGE)
   MESSAGE(FATAL_ERROR "\n"
     "Could not find the mumps library!\n"
index b8a555a146a891c6d478b94dc60045701f1e8ee7..7450fa78ca86480bc7fb832baa1717cc9b600fe2 100644 (file)
 # Configuration for the netcdf library:
 #
 
-
-MACRO(FEATURE_NETCDF_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${NETCDF_LIBRARIES})
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(NETCDF)
index 458b271c3e8172beb3224a103fef9e79e4b978f5..5da63d925974931a115528cfb0f9b9939fcacdc3 100644 (file)
@@ -36,19 +36,6 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
       SET(${var} TRUE)
     ENDIF()
   ENDIF()
-
-ENDMACRO()
-
-
-MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var)
-  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})
-
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${P4EST_LIBRARIES})
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 95e216be4c2a1d24460f673b4b73cebfe2b66d6e..3d4716b4cac408aaa9e262f41d41820528770b5a 100644 (file)
@@ -66,15 +66,13 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL var)
+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})
 
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES
-    ${PETSC_LIBRARIES}
-    )
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${PETSC_LIBRARIES})
 
   #
   # Disable a bunch of warnings when compiling with petsc:
@@ -88,8 +86,6 @@ MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL var)
     SET(DEAL_II_EXPAND_PETSC_MPI_VECTOR "PETScWrappers::MPI::Vector")
     SET(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR "PETScWrappers::MPI::BlockVector")
   ENDIF()
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index df29d78cd68996004f8df8eac3740d8e9aa166f6..a98af1590a45ea9fad92cdfa3f64f9e7aba372c4 100644 (file)
@@ -47,7 +47,7 @@ MACRO(FEATURE_SLEPC_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_SLEPC_CONFIGURE_EXTERNAL var)
+MACRO(FEATURE_SLEPC_CONFIGURE_EXTERNAL)
   INCLUDE_DIRECTORIES(${SLEPC_INCLUDE_DIRS})
 
   # The user has to know the location of the SLEPC headers as well:
@@ -56,8 +56,6 @@ MACRO(FEATURE_SLEPC_CONFIGURE_EXTERNAL var)
   LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES
     ${SLEPC_LIBRARIES}
     )
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 9fc42c061aaceaeb29cac3f64546928438d489b8..d13a4488968ebf3070ba740d4f4315d6d3389e4c 100644 (file)
@@ -157,7 +157,7 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var)
+MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
   INCLUDE_DIRECTORIES(${TRILINOS_INCLUDE_DIRS})
 
   # The user has to know the location of the trilinos headers as well:
@@ -182,7 +182,6 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var)
     SET(DEAL_II_EXPAND_TRILINOS_MPI_VECTOR "TrilinosWrappers::MPI::Vector")
   ENDIF()
 
-
   #
   #  used with -W -Wall (which includes -Wunused). Regrettable
   #  though it may be, these warnings pretty much drown everything
@@ -192,8 +191,6 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var)
   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-unused")
   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-extra")
   ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-overloaded-virtual")
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 620aa25062241713d4c7e04aafe2188a6e3ad7f7..2865357f956c6735464a0e22611944aeb4b7b3ad 100644 (file)
 SET(FEATURE_UMFPACK_DEPENDS DEAL_II_WITH_LAPACK)
 
 
-MACRO(FEATURE_UMFPACK_CONFIGURE_EXTERNAL var)
-
-  INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${UMFPACK_LIBRARIES})
-  ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${UMFPACK_LINKER_FLAGS}")
-
-  SET(${var} TRUE)
-ENDMACRO()
-
-
-MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED var)
-
+MACRO(FEATURE_UMFPACK_CONFIGURE_BUNDLED)
   INCLUDE_DIRECTORIES(
     ${UMFPACK_FOLDER}/UMFPACK/Include
     ${UMFPACK_FOLDER}/AMD/Include
     )
-
-  SET(${var} TRUE)
 ENDMACRO()
 
 
index 41fc235167cd8b8acb8c20fedb8f9d20a8435ee5..672836f6ba53e4f8eb8574b34ca1c29a6b845076 100644 (file)
 # Configuration for the zlib library:
 #
 
-
-MACRO(FEATURE_ZLIB_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${ZLIB_LIBRARIES})
-  SET(${var} TRUE)
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(ZLIB)
index a8edf6b156397e54246ff96ad8959be93b88017d..f80a79994d95dbacb86cc1b298def5205ee535e1 100644 (file)
 #     CONFIGURE_FEATURE(feature)
 #
 #
-# This macro uses the following variables and macros:
+# This macro uses the following optional variables and macros:
 #
-# FEATURE_${feature}_DEPENDS (variable, optional)
+# FEATURE_${feature}_DEPENDS (variable)
 #    a variable which contains an optional list of other features
 #    this feature depends on (and which have to be enbled for this feature
 #    to work.) The features must be given with the full option toggle:
 #    DEAL_II_WITH_[...]
 #
-# FEATURE_${feature}_HAVE_BUNDLED  (variable, optional)
+# FEATURE_${feature}_HAVE_BUNDLED  (variable)
 #    which should either be set to TRUE if all necessary libraries of the
 #    features comes bundled with deal.II and hence can be supported
 #    without external dependencies, or unset.
 #
-# FEATURE_${feature}_CONFIGURE_BUNDLED(var)  (macro, optional)
+# FEATURE_${feature}_CONFIGURE_BUNDLED(var)  (macro)
 #    which should setup all necessary configuration for the feature with
 #    bundled source dependencies. var set to TRUE indicates success,
 #    otherwise this script should issue a FATAL_ERROR.
 #
-# FEATURE_${feature}_FIND_EXTERNAL(var)  (macro, optional)
+# FEATURE_${feature}_FIND_EXTERNAL(var)  (macro)
 #    which should set var to TRUE if all dependencies for the feature are
 #    fullfilled. In this case all necessary variables for
 #    FEATURE_${feature}_CONFIGURE_EXTERNAL must be set. Otherwise
 #    var should remain unset.
 #    If not defined, FIND_PACKAGE(${feature}) is called.
 #
-# FEATURE_${feature}_CONFIGURE_EXTERNAL(var)  (macro, mandatory)
+# FEATURE_${feature}_CONFIGURE_EXTERNAL(var)  (macro)
 #    which should setup all necessary configuration for the feature with
-#    external dependencies. var set to TRUE indicates success,
-#    otherwise this script gives an error.
+#    external dependencies.
 #
-# FEATURE_${feature}_ERROR_MESSAGE()  (macro, optional)
+# FEATURE_${feature}_ERROR_MESSAGE()  (macro)
 #    which should print a meaningfull error message (with FATAL_ERROR) for
 #    the case that no external library was found (and bundled is not
 #    allowed to be used.) If not defined, a suitable default error message
@@ -124,6 +123,22 @@ MACRO(FEATURE_FIND_EXTERNAL _feature _var)
 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)
+    LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${${_feature}_LIBRARIES})
+  ENDIF()
+  IF(DEFINED ${_feature}_LINKER_FLAGS)
+    ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${${_feature}_LINKER_FLAGS}")
+  ENDIF()
+ENDMACRO()
+
+
 ###########################################################################
 #                                                                         #
 #                           CONFIGURE_FEATURE:                            #
@@ -199,17 +214,9 @@ MACRO(CONFIGURE_FEATURE _feature)
         # First case: DEAL_II_FORCE_BUNDLED_${_feature} is defined:
         #
         IF(FEATURE_${_feature}_HAVE_BUNDLED)
-          RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED(FEATURE_${_feature}_BUNDLED_CONFIGURED)")
-          IF(FEATURE_${_feature}_BUNDLED_CONFIGURED)
-            MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
-            SET_CACHED_OPTION(${_feature} ON)
-          ELSE()
-            # This should not happen. So give an error
-            MESSAGE(FATAL_ERROR
-              "\nInternal build system error: Failed to set up "
-              "DEAL_II_WITH_${_feature} with bundled packages.\n\n"
-              )
-          ENDIF()
+          RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
+          MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
+          SET_CACHED_OPTION(${_feature} ON)
         ELSE()
           MESSAGE(FATAL_ERROR "\n"
             "Internal build system error: DEAL_II_FORCE_BUNDLED_${_feature} "
@@ -229,35 +236,24 @@ MACRO(CONFIGURE_FEATURE _feature)
 
         IF(FEATURE_${_feature}_EXTERNAL_FOUND)
           MESSAGE(STATUS "All external dependencies for DEAL_II_WITH_${_feature} are fullfilled.")
-          RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL(FEATURE_${_feature}_EXTERNAL_CONFIGURED)")
 
-          IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED)
-            MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
-            SET_CACHED_OPTION(${_feature} ON)
+          IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL)
+            RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()")
           ELSE()
-            # This should not happen. So give an error
-            MESSAGE(FATAL_ERROR
-              "\nInternal build system error: Failed to set up "
-              "DEAL_II_WITH_${_feature} with external dependencies.\n\n"
-              )
+            FEATURE_CONFIGURE_EXTERNAL(${_feature})
           ENDIF()
 
+          MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with external dependencies.")
+          SET_CACHED_OPTION(${_feature} ON)
+
         ELSE(FEATURE_${_feature}_EXTERNAL_FOUND)
 
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} has unmet external dependencies.")
 
           IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED)
-            RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED(FEATURE_${_feature}_BUNDLED_CONFIGURED)")
-            IF(FEATURE_${_feature}_BUNDLED_CONFIGURED)
-              MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
-              SET_CACHED_OPTION(${_feature} ON)
-            ELSE()
-              # This should not happen. So give an error
-              MESSAGE(FATAL_ERROR
-                "\nInternal build system error: Failed to set up "
-                "DEAL_II_WITH_${_feature} with bundled packages.\n\n"
-                )
-            ENDIF()
+            RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
+            MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
+            SET_CACHED_OPTION(${_feature} ON)
           ELSE()
             IF(DEAL_II_WITH_${_feature})
               IF(COMMAND FEATURE_${_feature}_ERROR_MESSAGE)
@@ -271,6 +267,7 @@ MACRO(CONFIGURE_FEATURE _feature)
           ENDIF()
 
         ENDIF(FEATURE_${_feature}_EXTERNAL_FOUND)
+
       ENDIF()
     ENDIF()
   ELSE()
index affb69a78239e71ac00b761f3c453bc91bf5fc43..866f2001d1cc83de040b23b0a4537682dc935930 100644 (file)
@@ -90,6 +90,7 @@ IF(MUMPS_FOUND)
     ${DMUMPS_LIBRARY}
     ${MUMPS_COMMON_LIBRARY}
     ${SCALAPACK_LIBRARIES}
+    ${MPI_CXX_LIBRARIES} # For good measure
     )
   SET(MUMPS_LINKER_FLAGS
     ${SCALAPACK_LINKER_FLAGS}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.