]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Some refactoring
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 19 Sep 2012 23:35:09 +0000 (23:35 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 19 Sep 2012 23:35:09 +0000 (23:35 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26538 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/contrib/cmake/configure/configure_boost.cmake
deal.II/contrib/cmake/configure/configure_doxygen.cmake [new file with mode: 0644]
deal.II/contrib/cmake/configure/configure_umfpack.cmake
deal.II/contrib/cmake/macros/macro_configure_feature.cmake

index 0db427acef781dbcbd3c096c9f06ea3994a78a05..98287a12dcb561db8cded184fb2610dc0bef1903 100644 (file)
@@ -9,15 +9,16 @@ SET(DEAL_II_WITH_BOOST "ON"
   CACHE STRING "Build deal.II with support for boost." FORCE
   )
 
+
 #
 # This configure script has to be included after configure_tbb.
 # We need some of the variables defined in SETUP_THREADING for
 # the setup of the contrib boost library (if used)
 #
-IF(NOT FEATURE_TBB_HAVE_CONTRIB)
-  MESSAGE(FATAL_ERROR
-    "Internal build system error: configure_boost.cmake included "
-    "before configure_tbb.cmake"
+IF(NOT FEATURE_TBB_PROCESSED)
+  MESSAGE(FATAL_ERROR "\n"
+    "Internal build system error:\n"
+    "configure_boost.cmake included before configure_tbb.cmake\n\n"
     )
 ENDIF()
 
diff --git a/deal.II/contrib/cmake/configure/configure_doxygen.cmake b/deal.II/contrib/cmake/configure/configure_doxygen.cmake
new file mode 100644 (file)
index 0000000..3a3177d
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Configuration for doxygen
+#
+
+MACRO(FEATURE_DOXYGEN_FIND_EXTERNAL var)
+
+  FIND_PACKAGE(Doxygen)
+
+  #
+  # We use doxygen and dot:
+  #
+  IF(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
+    SET(${var} TRUE)
+  ENDIF()
+
+ENDMACRO()
+
+
+MACRO(FEATURE_DOXYGEN_CONFIGURE_EXTERNAL var)
+
+  #
+  # The FindDoxygen defines for us:
+  #
+  #   DOXYGEN_EXECUTABLE     = The path to the doxygen command.
+  #   DOXYGEN_FOUND          = Was Doxygen found or not?
+  #   DOXYGEN_VERSION        = The version reported by doxygen --version
+  #
+  #   DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
+  #   DOXYGEN_DOT_FOUND      = Was Dot found or not?
+  #   DOXYGEN_DOT_PATH       = The path to dot not including the executable
+  #
+  # Use these variables to set up a custom target:
+  #
+
+  SET(${var} TRUE)
+
+ENDMACRO()
+
+
+SET(FEATURE_DOXYGEN_CUSTOM_ERROR_MESSAGE TRUE)
+
+
+MACRO(FEATURE_DOXYGEN_ERROR_MESSAGE)
+  MESSAGE(SEND_ERROR "\n"
+    "Could not find the doxygen package!\n\n"
+    "Please ensure that doxygen and dot are installed on your computer.\n"
+    "If the packages are not at a default location, either provide some hints\n"
+    "for the autodetection, or set the relevant variables by hand in ccmake.\n\n"
+    )
+ENDMACRO()
+
+
+CONFIGURE_FEATURE(DOXYGEN)
+
index c640ba5bd01e5f2d7b5b964237867f094fb4f1c7..bed5192e39833c5c3795f92e0d7751ef5086e6f5 100644 (file)
@@ -8,12 +8,6 @@ SET(FEATURE_UMFPACK_DEPENDS
   DEAL_II_WITH_LAPACK
   )
 
-#
-# This configure script has to be included after configure_blas and
-# configure_lapack.
-#
-# TODO: Write a check for this
-
 
 MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
 
index 1aa87d25accb36815b3e89bff2d82109dac26ef0..37e3e421a72682df013ac3342489120e6b6eaa00 100644 (file)
@@ -110,6 +110,24 @@ ENDMACRO()
 
 MACRO(CONFIGURE_FEATURE feature)
 
+  #
+  # Check for correct include order of the configure_*.cmake files:
+  # If feature B depends on feature A, configure_A.cmake has to be
+  # included before configure_B.cmake:
+  #
+  FOREACH(macro_dependency ${FEATURE_${feature}_DEPENDS})
+    STRING(REGEX REPLACE "^DEAL_II_WITH_" "" macro_dependency ${macro_dependency})
+    MESSAGE("${macro_dependency}")
+    IF(NOT FEATURE_${macro_dependency}_PROCESSED)
+      MESSAGE(FATAL_ERROR "\n"
+        "Internal build system error:\nDEAL_II_WITH_${feature} depends on "
+        "DEAL_II_WITH_${macro_dependency},\nbut CONFIGURE_FEATURE(${feature}) "
+        "was called before CONFIGURE_FEATURE(${macro_dependency}).\n\n"
+        )
+    ENDIF()
+  ENDFOREACH()
+
+
   # Only try to configure ${feature} if we have to:
   IF(DEAL_II_FEATURE_AUTODETECTION OR DEAL_II_WITH_${feature})
 
@@ -258,4 +276,7 @@ MACRO(CONFIGURE_FEATURE feature)
     ENDIF()
 
   ENDIF()
+
+  SET(FEATURE_${feature}_PROCESSED TRUE)
+
 ENDMACRO()

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.