]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Refactor the configure_feature macro
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 09:16:24 +0000 (09:16 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Sep 2012 09:16:24 +0000 (09:16 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26427 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/CMakeLists.txt
deal.II/contrib/cmake/configure/configure_blas.cmake
deal.II/contrib/cmake/configure/configure_boost.cmake
deal.II/contrib/cmake/configure/configure_functionparser.cmake
deal.II/contrib/cmake/configure/configure_lapack.cmake
deal.II/contrib/cmake/configure/configure_metis.cmake
deal.II/contrib/cmake/configure/configure_mpi.cmake
deal.II/contrib/cmake/configure/configure_netcdf.cmake
deal.II/contrib/cmake/configure/configure_tbb.cmake
deal.II/contrib/cmake/configure/configure_umfpack.cmake
deal.II/contrib/cmake/configure/configure_zlib.cmake
deal.II/contrib/cmake/macros/macro_configure_feature.cmake

index ef1ada3c484fd1a5d5cbd6fc153ed7c5c52c6084..26be28f67ceabf8002fea4d2a91d7f20b470fed7 100644 (file)
@@ -132,7 +132,7 @@ OPTION(DEAL_II_FORCE_CONTRIB_TBB
 
 OPTION(DEAL_II_WITH_UMFPACK
   "Build deal.II with support for UMFPACK."
-  OFF)
+  ON)
 OPTION(DEAL_II_FORCE_CONTRIB_UMFPACK
   "Always use the bundled umfpack library instead of an external one."
   OFF)
index 8dca2da1b6ba299b55675e9b1c9877c563ded2f7..71a4db091dd0e0cd4bfe0ad8c2ed93c556f8b067 100644 (file)
@@ -4,7 +4,7 @@
 
 INCLUDE(CheckFunctionExists)
 
-MACRO(FIND_FEATURE_BLAS_EXTERNAL var)
+MACRO(FEATURE_BLAS_FIND_EXTERNAL var)
 
   FIND_PACKAGE(BLAS)
 
@@ -15,7 +15,7 @@ MACRO(FIND_FEATURE_BLAS_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BLAS_EXTERNAL var)
+MACRO(FEATURE_BLAS_CONFIGURE_EXTERNAL var)
 
   SET(CMAKE_SHARED_LINKER_FLAGS
     "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
@@ -58,16 +58,4 @@ MACRO(CONFIGURE_FEATURE_BLAS_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BLAS_ERROR_MESSAGE)
-  MESSAGE(SEND_ERROR "
-Could not find the blas library!
-
-Please ensure that the blas library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(BLAS)
index 7ce09063bc8db2a2d3c5fb9e10561c05393e2179..e1b985eea4d6ede0e0a9cf7dffaa73976c67e175 100644 (file)
@@ -8,7 +8,7 @@ SET(DEAL_II_WITH_BOOST "ON"
   )
 
 
-MACRO(FIND_FEATURE_BOOST_EXTERNAL var)
+MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
 
   FIND_PACKAGE (Boost COMPONENTS serialization thread)
 
@@ -22,7 +22,7 @@ MACRO(FIND_FEATURE_BOOST_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BOOST_EXTERNAL var)
+MACRO(FEATURE_BOOST_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIR})
 
@@ -40,10 +40,10 @@ MACRO(CONFIGURE_FEATURE_BOOST_EXTERNAL var)
 ENDMACRO()
 
 
-SET(HAVE_CONTRIB_FEATURE_BOOST TRUE)
+SET(FEATURE_BOOST_HAVE_CONTRIB TRUE)
 
 
-MACRO(CONFIGURE_FEATURE_BOOST_CONTRIB var)
+MACRO(FEATURE_BOOST_CONFIGURE_CONTRIB var)
 
   # compile the necessary parts of boost out of ./contrib
 
@@ -79,20 +79,4 @@ MACRO(CONFIGURE_FEATURE_BOOST_CONTRIB var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BOOST_ERROR_MESSAGE)
-    MESSAGE(SEND_ERROR "
-Could not find the boost library!
-
-Please ensure that the boost library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-Alternatively you may choose to compile the bundled contrib library of
-boost by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_BOOST=on.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(BOOST)
index 39dcf61d3c72426e6387c34b4fcfa9e48cbd16d3..77e2237367a6ad4b9a8bdd802632425c9fd61162 100644 (file)
@@ -1,15 +1,19 @@
-MACRO(FIND_FEATURE_FUNCTIONPARSER_EXTERNAL var)
+MACRO(FEATURE_FUNCTIONPARSER_FIND_EXTERNAL var)
+  MESSAGE(WARNING "
+Module for finding functionparser not written, yet!
+
+")
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_EXTERNAL var)
+MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_EXTERNAL var)
 ENDMACRO()
 
 
-SET(HAVE_CONTRIB_FEATURE_FUNCTIONPARSER TRUE)
+SET(FEATURE_FUNCTIONPARSER_HAVE_CONTRIB TRUE)
 
 
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_CONTRIB var)
+MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_CONTRIB var)
 
   # compile the necessary parts of functionparser out of ./contrib
 
@@ -32,18 +36,4 @@ MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_CONTRIB var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_FUNCTIONPARSER_ERROR_MESSAGE)
-    MESSAGE(SEND_ERROR "
-Could not find the functionparser library!
-
-Module not written, yet...
-
-You may want to choose to compile the bundled contrib library of
-functionparser by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_FUNCTIONPARSER=on.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(FUNCTIONPARSER)
index b7507df24de125384b6558ae843edeeeffce61b1..532f5a8c27cd4ade6bd23da117239abf6344fb62 100644 (file)
@@ -2,7 +2,7 @@
 # Configuration for the lapack library:
 #
 
-MACRO(FIND_FEATURE_LAPACK_EXTERNAL var)
+MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
 
   FIND_PACKAGE(LAPACK)
 
@@ -13,7 +13,7 @@ MACRO(FIND_FEATURE_LAPACK_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_LAPACK_EXTERNAL var)
+MACRO(FEATURE_LAPACK_CONFIGURE_EXTERNAL var)
 
   SET(CMAKE_SHARED_LINKER_FLAGS
     "${CMAKE_SHARED_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}"
@@ -58,16 +58,4 @@ MACRO(CONFIGURE_FEATURE_LAPACK_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BLAS_ERROR_MESSAGE)
-  MESSAGE(SEND_ERROR "
-Could not find the lapack library!
-
-Please ensure that the lapack library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(LAPACK)
index c7f8e24177346fd5e097b06888b518681dad6624..385b42df0c60c8d82334654a95c5889ee9c1e781 100644 (file)
@@ -2,23 +2,30 @@
 # Configuration for the netcdf library:
 #
 
-MACRO(FIND_FEATURE_METIS_EXTERNAL var)
+MACRO(FEATURE_METIS_FIND_EXTERNAL var)
 
   FIND_PACKAGE(METIS)
 
   IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
     SET(${var} TRUE)
   ELSE()
-    MESSAGE(STATUS
-      "Could not find a sufficient modern metis installation: Version 5.x
-      required."
+    MESSAGE(WARNING "
+Could not find a sufficient modern metis installation:
+Version 5.x required!
+
+Please ensure that a sufficiently modern version of metis is installed on
+your computer. If the library is not at a default location, either provide
+some hints for the autodetection, or set the relevant variables by hand in
+ccmake.
+
+"
       )
   ENDIF()
 
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_METIS_EXTERNAL var)
+MACRO(FEATURE_METIS_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIR})
   LIST(APPEND deal_ii_external_libraries ${METIS_LIBRARY})
@@ -29,20 +36,4 @@ MACRO(CONFIGURE_FEATURE_METIS_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_METIS_ERROR_MESSAGE)
-
-  MESSAGE(SEND_ERROR "
-Could not find the metis library!
-
-Please ensure that the metis version 5.x is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-METIS_LIBRARY_DIR METIS_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-")
-
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(METIS)
index 322ad8ac9f6471cb52d8574ff41dffeac4808c44..1c1b8eae4a9798288f72aa8008170ecf718539c1 100644 (file)
@@ -2,7 +2,7 @@
 # Configuration for mpi support:
 #
 
-MACRO(FIND_FEATURE_MPI_EXTERNAL var)
+MACRO(FEATURE_MPI_FIND_EXTERNAL var)
 
   FIND_PACKAGE(MPI)
 
@@ -13,7 +13,7 @@ MACRO(FIND_FEATURE_MPI_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_MPI_EXTERNAL var)
+MACRO(FEATURE_MPI_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${MPI_CXX_INCLUDE_PATH})
   SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
@@ -22,6 +22,8 @@ MACRO(CONFIGURE_FEATURE_MPI_EXTERNAL var)
   SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
 
 
+  # TODO: Set up the rest:
+
   #MPI_CXX_COMPILER        MPI Compiler wrapper for CXX
   #MPI_CXX_COMPILE_FLAGS   Compilation flags for MPI programs
 
@@ -36,8 +38,9 @@ MACRO(CONFIGURE_FEATURE_MPI_EXTERNAL var)
   SET(${var} TRUE)
 ENDMACRO()
 
+SET(FEATURE_MPI_CUSTOM_ERROR_MESSAGE TRUE)
 
-MACRO(CONFIGURE_FEATURE_MPI_ERROR_MESSAGE)
+MACRO(FEATURE_MPI_ERROR_MESSAGE)
   MESSAGE(SEND_ERROR "
 Could not find any suitable mpi library!
 
index 102d19400df7ee44bda0cc6613086c3b94877ade..e5f2eba600351c0ca89ca9ad27bc6cf97b1cddcb 100644 (file)
@@ -2,7 +2,7 @@
 # Configuration for the netcdf library:
 #
 
-MACRO(FIND_FEATURE_NETCDF_EXTERNAL var)
+MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
 
   FIND_PACKAGE(NETCDF)
 
@@ -13,7 +13,7 @@ MACRO(FIND_FEATURE_NETCDF_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_NETCDF_EXTERNAL var)
+MACRO(FEATURE_NETCDF_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
   LIST(APPEND deal_ii_external_libraries ${NETCDF_LIBRARY})
@@ -23,20 +23,4 @@ MACRO(CONFIGURE_FEATURE_NETCDF_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_NETCDF_ERROR_MESSAGE)
-
-  MESSAGE(SEND_ERROR "
-Could not find the netcdf library!
-
-Please ensure that the netcdf library is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-NETCDF_LIBRARY_DIR NETCDF_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-")
-
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(NETCDF)
index 5f1e21432bec8394e230f322805d16848b82f60d..e8883da6e70400163cd7642e68eeb1c8981d699d 100644 (file)
@@ -84,7 +84,7 @@ ENDMACRO()
 # Set up the tbb library:
 #
 
-MACRO(FIND_FEATURE_TBB_EXTERNAL var)
+MACRO(FEATURE_TBB_FIND_EXTERNAL var)
 
   FIND_PACKAGE(TBB)
 
@@ -100,7 +100,7 @@ MACRO(FIND_FEATURE_TBB_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_TBB_EXTERNAL var)
+MACRO(FEATURE_TBB_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR})
 
@@ -115,10 +115,10 @@ MACRO(CONFIGURE_FEATURE_TBB_EXTERNAL var)
 ENDMACRO()
 
 
-SET(HAVE_CONTRIB_FEATURE_TBB TRUE)
+SET(FEATURE_TBB_HAVE_CONTRIB TRUE)
 
 
-MACRO(CONFIGURE_FEATURE_TBB_CONTRIB var)
+MACRO(FEATURE_TBB_CONFIGURE_CONTRIB var)
   #
   # Add tbb directly to the object files of deal.II
   #
@@ -139,22 +139,4 @@ MACRO(CONFIGURE_FEATURE_TBB_CONTRIB var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_TBB_ERROR_MESSAGE)
-    MESSAGE(SEND_ERROR "
-Could not find the tbb library!
-
-Please ensure that the tbb library is installed on your computer.
-If the library is not at a default location, either provide some hints
-via environment variables:
-TBB_LIBRARY_DIR TBB_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
-
-Alternatively you may choose to compile the bundled contrib library of
-boost by setting DEAL_II_ALLOW_CONTRIB=on or
-DEAL_II_FORCE_CONTRIB_TBB=on.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(TBB)
index 98018cf35b1ca838a2e04cd942c27b2479d68dae..592f0d72be6c2c0e8ae3559cf4e06afd69d9cd03 100644 (file)
@@ -9,19 +9,19 @@ SET(FEATURE_UMFPACK_DEPENDS
   )
 
 
-MACRO(FIND_FEATURE_UMFPACK_EXTERNAL var)
+MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
 
   FIND_PACKAGE(UMFPACK)
   FIND_PACKAGE(AMD)
 
   IF(UMFPACK_FOUND AND AMD_FOUND)
-    SET(${var} TRUE)
+    #SET(${var} TRUE)
   ENDIF()
 
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_UMFPACK_EXTERNAL var)
+MACRO(FEATURE_UMFPACK_CONFIGURE_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
 
@@ -36,10 +36,10 @@ MACRO(CONFIGURE_FEATURE_UMFPACK_EXTERNAL var)
 ENDMACRO()
 
 
-SET(HAVE_CONTRIB_FEATURE_UMFPACK TRUE)
+SET(FEATURE_UMFPACK_HAVE_CONTRIB TRUE)
 
 
-MACRO(CONFIGURE_FEATURE_UMFPACK_CONTRIB var)
+MACRO(FEATURE_UMFPACK_CONFIGURE_CONTRIB var)
 
   INCLUDE_DIRECTORIES(
     ${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Include
@@ -66,16 +66,16 @@ MACRO(CONFIGURE_FEATURE_UMFPACK_CONTRIB var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_BOOST_ERROR_MESSAGE)
+SET(FEATURE_UMFPACK_CUSTOM_ERROR_MESSAGE TRUE)
+
+
+MACRO(FEATURE_UMFPACK_ERROR_MESSAGE)
   MESSAGE(SEND_ERROR "
 Could not find the umfpack and amd libraries!
 
 Please ensure that the libraries are installed on your computer.
 If the libraries are not at a default location, either provide some hints
-via environment variables:
-UMFPACK_LIBRARY_DIR UMFPACK_INCLUDE_DIR
-AMD_LIBRARY_DIR AMD_INCLUDE_DIR
-Or set the relevant variables by hand in ccmake.
+for the autodetection, or set the relevant variables by hand in ccmake.
 
 Alternatively you may choose to compile the bundled contrib libraries
 by setting DEAL_II_ALLOW_CONTRIB=on or DEAL_II_FORCE_CONTRIB_UMFPACK=on.
index ef987982301c6fae8a6873866e11ba8836cf371b..29e9c93fafc21419a29deb335df0e34c2a3e5b7f 100644 (file)
@@ -2,7 +2,7 @@
 # Configuration for the zlib library:
 #
 
-MACRO(FIND_FEATURE_ZLIB_EXTERNAL var)
+MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
 
   FIND_PACKAGE(ZLIB)
 
@@ -13,7 +13,7 @@ MACRO(FIND_FEATURE_ZLIB_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_ZLIB_EXTERNAL var)
+MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
 
   INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
   LIST(APPEND deal_ii_external_libraries ${ZLIB_LIBRARIES})
@@ -24,16 +24,4 @@ MACRO(CONFIGURE_FEATURE_ZLIB_EXTERNAL var)
 ENDMACRO()
 
 
-MACRO(CONFIGURE_FEATURE_ZLIB_ERROR_MESSAGE)
-  MESSAGE(SEND_ERROR "
-Could not find the zlib library!
-
-Please ensure that the zlib library is installed on your computer.
-If the library is not at a default location, either provide some hints
-for the autodetection, or set the relevant variables by hand in ccmake.
-
-")
-ENDMACRO()
-
-
 CONFIGURE_FEATURE(ZLIB)
index b163f125b5de1c70155d8fbf1d61d110d5e6c947..d8cfb063ae7a3c24d29aecc6bd62f849003a337c 100644 (file)
@@ -3,43 +3,52 @@
 #
 # Usage:
 #
-# CONFIGURE_FEATURE(feature_name)
+# CONFIGURE_FEATURE(feature)
+#
 #
 # This macro assumes the following macros and variables to be defined:
 #
-# FEATURE_${feature_name}_DEPENDS (variable)
+# FEATURE_${feature}_DEPENDS (variable, optional)
 #
-#  - A variable which contains an optional list of features this feature
+#    a variable which contains an optional list of features this feature
 #    depends on (and which have to be enbled for this feature to work.)
 #
-# HAVE_CONTRIB_FEATURE_${feature_name}  (variable)
 #
-#   - Which is either 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}_HAVE_CONTRIB  (variable, optional)
+#
+#    which shall 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_CONTRIB(var)  (macro, optional)
+#
+#    which shall setup all necessary configuration for the feature with
+#    contrib source dependencies. var set to TRUE shall indicate success.
 #
-# CONFIGURE_FEATURE_${feature_name}_CONTRIB(var)  (macro)
 #
-#   - which shall setup all necessary configuration for the feature with
-#     contrib source dependencies. var set to TRUE shall indicate success.
+# FEATURE_${feature}_FIND_EXTERNAL(var)  (macro)
 #
+#    which shall 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.
 #
-# FIND_FEATURE_${feature_name}_EXTERNAL(var)  (macro)
+# FEATURE_${feature}_CONFIGURE_EXTERNAL(var)  (macro)
 #
-#   - which shall set var to TRUE if all dependencies for the feature are
-#     fullfilled. In this case all necessary variables for
-#     CONFIGURE_FEATURE_${feature_name}_EXTERNAL shall be set. Otherwise
-#     var should remain unset.
+#    which shall setup all necessary configuration for the feature with
+#    external dependencies. var set to TRUE shall indicate success.
 #
-# CONFIGURE_FEATURE_${feature_name}_EXTERNAL(var)  (macro)
 #
-#   - which shall setup all necessary configuration for the feature with
-#     external dependencies. var set to TRUE shall indicate success.
+# FEATURE_${feature}_CUSTOM_ERROR_MESSAGE() (variable, optional)
 #
-# CONFIGURE_FEATURE_${feature_name}_ERROR_MESSAGE()  (macro)
+#    which shall either be set to TRUE if FEATURE_${feature}_ERROR_MESSAGE
+#    is set up, or be undefined.
 #
-#   - which shall print a meaningfull error message if case no external
-#     library is found (and contrib is not allowed to be used.)
+# FEATURE_${feature}_ERROR_MESSAGE()  (macro, optional)
+#
+#    which shall print a meaningfull error message if case no external
+#    library is found (and contrib is not allowed to be used.)
+#    If not defined, a suitable default error message will be printed.
 #
 #
 
@@ -73,6 +82,37 @@ MACRO(SET_CACHED_OPTION str value)
 ENDMACRO()
 
 
+#
+# A small macro to post an error message:
+#
+MACRO(FEATURE_ERROR_MESSAGE feature)
+  STRING(TOLOWER ${feature} feature_lowercase)
+  IF(FEATURE_${feature}_HAVE_CONTRIB)
+    MESSAGE(SEND_ERROR "
+Could not find the ${feature_lowercase} library!
+
+Please ensure that the ${feature_lowercase} library is installed on your computer.
+If the library is not at a default location, either provide some hints
+for the autodetection, or set the relevant variables by hand in ccmake.
+
+Alternatively you may choose to compile the bundled contrib library of
+${feature_lowercase} by setting DEAL_II_ALLOW_CONTRIB=on or
+DEAL_II_FORCE_CONTRIB_${feature}=on.
+
+")
+ ELSE()
+    MESSAGE(SEND_ERROR "
+Could not find the ${feature_lowercase} library!
+
+Please ensure that the ${feature_lowercase} library is installed on your computer.
+If the library is not at a default location, either provide some hints
+for the autodetection, or set the relevant variables by hand in ccmake.
+
+")
+  ENDIF()
+ENDMACRO()
+
+
 MACRO(CONFIGURE_FEATURE feature)
 
   # Only try to configure ${feature} if we have to:
@@ -108,10 +148,10 @@ MACRO(CONFIGURE_FEATURE feature)
       #
       IF(DEAL_II_FORCE_CONTRIB_${feature})
 
-        IF(HAVE_CONTRIB_FEATURE_${feature})
+        IF(FEATURE_${feature}_HAVE_CONTRIB)
           RUN_COMMAND(
             "
-            CONFIGURE_FEATURE_${feature}_CONTRIB(
+            FEATURE_${feature}_CONFIGURE_CONTRIB(
               FEATURE_${feature}_CONTRIB_CONFIGURED
               )
             "
@@ -131,7 +171,7 @@ MACRO(CONFIGURE_FEATURE feature)
           ENDIF()
         ELSE()
           MESSAGE(FATAL_ERROR
-            "Internal build system error: DEAL_II_FORCE_CONTRIB_${feature} defined, but HAVE_CONTRIB_FEATURE_${feature} not present."
+            "Internal build system error: DEAL_II_FORCE_CONTRIB_${feature} defined, but FEATURE_${feature}_HAVE_CONTRIB not present."
             )
         ENDIF()
 
@@ -141,7 +181,7 @@ MACRO(CONFIGURE_FEATURE feature)
         # Second case: We are allowed to search for an external library:
         #
         RUN_COMMAND(
-          "FIND_FEATURE_${feature}_EXTERNAL(FEATURE_${feature}_EXTERNAL_FOUND)"
+          "FEATURE_${feature}_FIND_EXTERNAL(FEATURE_${feature}_EXTERNAL_FOUND)"
           )
 
         IF(FEATURE_${feature}_EXTERNAL_FOUND)
@@ -152,7 +192,7 @@ MACRO(CONFIGURE_FEATURE feature)
 
           RUN_COMMAND(
             "
-            CONFIGURE_FEATURE_${feature}_EXTERNAL(
+            FEATURE_${feature}_CONFIGURE_EXTERNAL(
               FEATURE_${feature}_EXTERNAL_CONFIGURED
               )
             "
@@ -178,10 +218,10 @@ MACRO(CONFIGURE_FEATURE feature)
             "DEAL_II_WITH_${feature} has unmet external dependencies."
             )
 
-          IF(HAVE_CONTRIB_FEATURE_${feature} AND DEAL_II_ALLOW_CONTRIB)
+          IF(FEATURE_${feature}_HAVE_CONTRIB AND DEAL_II_ALLOW_CONTRIB)
             RUN_COMMAND(
               "
-              CONFIGURE_FEATURE_${feature}_CONTRIB(
+              FEATURE_${feature}_CONFIGURE_CONTRIB(
                 FEATURE_${feature}_CONTRIB_CONFIGURED
                 )
               "
@@ -203,9 +243,15 @@ MACRO(CONFIGURE_FEATURE feature)
               IF(DEAL_II_FEATURE_AUTODETECTION)
                 SET_CACHED_OPTION(DEAL_II_WITH_${feature} ON)
               ELSE()
-                RUN_COMMAND(
-                  "CONFIGURE_FEATURE_${feature}_ERROR_MESSAGE()"
-                  )
+                IF(FEATURE_${feature}_CUSTOM_ERROR_MESSAGE)
+                  RUN_COMMAND(
+                    "
+                    FEATURE_${feature}_ERROR_MESSAGE()
+                    "
+                    )
+                ELSE()
+                  FEATURE_ERROR_MESSAGE(${feature})
+                ENDIF()
               ENDIF()
           ENDIF()
         ENDIF()

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.