From: maier Date: Wed, 19 Sep 2012 23:35:09 +0000 (+0000) Subject: Some refactoring X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e6a811e6a209a32533e4fa72c6ff48d5d737e05;p=dealii-svn.git Some refactoring git-svn-id: https://svn.dealii.org/branches/branch_cmake@26538 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/cmake/configure/configure_boost.cmake b/deal.II/contrib/cmake/configure/configure_boost.cmake index 0db427acef..98287a12dc 100644 --- a/deal.II/contrib/cmake/configure/configure_boost.cmake +++ b/deal.II/contrib/cmake/configure/configure_boost.cmake @@ -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 index 0000000000..3a3177d614 --- /dev/null +++ b/deal.II/contrib/cmake/configure/configure_doxygen.cmake @@ -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) + diff --git a/deal.II/contrib/cmake/configure/configure_umfpack.cmake b/deal.II/contrib/cmake/configure/configure_umfpack.cmake index c640ba5bd0..bed5192e39 100644 --- a/deal.II/contrib/cmake/configure/configure_umfpack.cmake +++ b/deal.II/contrib/cmake/configure/configure_umfpack.cmake @@ -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) diff --git a/deal.II/contrib/cmake/macros/macro_configure_feature.cmake b/deal.II/contrib/cmake/macros/macro_configure_feature.cmake index 1aa87d25ac..37e3e421a7 100644 --- a/deal.II/contrib/cmake/macros/macro_configure_feature.cmake +++ b/deal.II/contrib/cmake/macros/macro_configure_feature.cmake @@ -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()