]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Some sanity, part II:
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 May 2014 16:14:45 +0000 (16:14 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 15 May 2014 16:14:45 +0000 (16:14 +0000)
* Define global suffix lists for all the FOREACH loops over feature and
  deal.II variables.

* Sanely purge all variables associated with a feature if the feature gets
  disabled

git-svn-id: https://svn.dealii.org/trunk@32904 0785d39b-7218-0410-832d-ea1e28bc413d

22 files changed:
deal.II/cmake/configure/configure_2_metis.cmake
deal.II/cmake/configure/configure_2_trilinos.cmake
deal.II/cmake/configure/configure_3_petsc.cmake
deal.II/cmake/configure/configure_hdf5.cmake
deal.II/cmake/configure/configure_mumps.cmake
deal.II/cmake/configure/configure_p4est.cmake
deal.II/cmake/configure/configure_slepc.cmake
deal.II/cmake/macros/macro_configure_feature.cmake
deal.II/cmake/macros/macro_deal_ii_package_handle.cmake
deal.II/cmake/macros/macro_purge_feature.cmake [new file with mode: 0644]
deal.II/cmake/macros/macro_register_feature.cmake
deal.II/cmake/modules/FindHDF5.cmake
deal.II/cmake/modules/FindMUMPS.cmake
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/modules/FindSLEPC.cmake
deal.II/cmake/modules/FindTBB.cmake
deal.II/cmake/modules/FindTRILINOS.cmake
deal.II/cmake/modules/FindUMFPACK.cmake
deal.II/cmake/setup_deal_ii.cmake
deal.II/cmake/setup_finalize.cmake
deal.II/cmake/setup_write_config.cmake

index 739c7a62749372c5916b0f12c0b281ecc46eca24..34a47ca1d8e397872336930fbaa30effe542ed56 100644 (file)
 MACRO(FEATURE_METIS_FIND_EXTERNAL var)
   FIND_PACKAGE(METIS)
 
-  IF(METIS_FOUND)
-    IF(METIS_VERSION_MAJOR GREATER 4)
-      SET(${var} TRUE)
-    ELSE()
-      MESSAGE(STATUS "Insufficient metis installation found: "
-        "Version 5.x required!"
-        )
-      SET(METIS_ADDITIONAL_ERROR_STRING
-        "Could not find a sufficient modern metis installation: "
-        "Version 5.x required!\n"
-        )
-
-      UNSET(METIS_LIBRARY CACHE)
-      UNSET(METIS_INCLUDE_DIR CACHE)
-      SET(METIS_DIR "" CACHE PATH
-        "An optional hint to a metis directory"
-        )
-      MARK_AS_ADVANCED(CLEAR METIS_DIR)
-    ENDIF()
+  IF(METIS_FOUND AND METIS_VERSION_MAJOR GREATER 4)
+    SET(${var} TRUE)
+  ELSE()
+    MESSAGE(STATUS "Insufficient metis installation found: "
+      "Version 5.x required!"
+      )
+    SET(METIS_ADDITIONAL_ERROR_STRING
+      "Could not find a sufficient modern metis installation: "
+      "Version 5.x required!\n"
+      )
   ENDIF()
 ENDMACRO()
 
index b7b000621152424734416a97fae8f5d233c80a4b..2977f388469929c9164b55f6917a26076db45ba6 100644 (file)
@@ -179,24 +179,11 @@ MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
         SET(${var} FALSE)
       ENDIF()
     ENDIF()
-
-  ENDIF(TRILINOS_FOUND)
-
-  IF(NOT ${var})
-    UNSET(TRILINOS_CONFIG CACHE)
-    SET(TRILINOS_DIR "" CACHE STRING
-      "An optional hint to a Trilinos installation"
-      )
-    MARK_AS_ADVANCED(CLEAR TRILINOS_DIR)
   ENDIF()
-
 ENDMACRO()
 
 
 MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
-
-  SET(TRILINOS_USER_INCLUDE_DIRS ${TRILINOS_INCLUDE_DIRS})
-
   SET(DEAL_II_EXPAND_TRILINOS_VECTOR "TrilinosWrappers::Vector")
   SET(DEAL_II_EXPAND_TRILINOS_BLOCKVECTOR "TrilinosWrappers::BlockVector")
   SET(DEAL_II_EXPAND_TRILINOS_SPARSITY_PATTERN "TrilinosWrappers::SparsityPattern")
@@ -210,7 +197,6 @@ MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL)
   ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-unused")
   ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-extra")
   ENABLE_IF_SUPPORTED(TRILINOS_CXX_FLAGS "-Wno-overloaded-virtual")
-
 ENDMACRO()
 
 
index 81cdd69e30149ae60a32cb0b57ea8f602969cf86..60d0f8e10bae4443671f756102feeccdac4547e8 100644 (file)
@@ -93,37 +93,20 @@ MACRO(FEATURE_PETSC_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
-
-    IF(NOT ${var})
-      UNSET(PETSC_INCLUDE_DIR_ARCH CACHE)
-      UNSET(PETSC_INCLUDE_DIR_COMMON CACHE)
-      UNSET(PETSC_LIBRARY CACHE)
-      UNSET(PETSC_PETSCVARIABLES CACHE)
-      SET(PETSC_DIR "" CACHE PATH
-        "An optional hint to a PETSc directory"
-        )
-      SET(PETSC_ARCH "" CACHE STRING
-        "An optional hint to a PETSc arch"
-        )
-      MARK_AS_ADVANCED(CLEAR PETSC_DIR PETSC_ARCH)
-    ENDIF()
   ENDIF()
 ENDMACRO()
 
 
 MACRO(FEATURE_PETSC_CONFIGURE_EXTERNAL)
-
-  SET(PETSC_USER_INCLUDE_DIRS ${PETSC_INCLUDE_DIRS})
+  SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector")
+  SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector")
+  SET(DEAL_II_EXPAND_PETSC_MPI_VECTOR "PETScWrappers::MPI::Vector")
+  SET(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR "PETScWrappers::MPI::BlockVector")
 
   #
   # Disable a bunch of warnings when compiling with petsc:
   #
   ENABLE_IF_SUPPORTED(PETSC_CXX_FLAGS "-Wno-long-long")
-
-  SET(DEAL_II_EXPAND_PETSC_VECTOR "PETScWrappers::Vector")
-  SET(DEAL_II_EXPAND_PETSC_BLOCKVECTOR "PETScWrappers::BlockVector")
-  SET(DEAL_II_EXPAND_PETSC_MPI_VECTOR "PETScWrappers::MPI::Vector")
-  SET(DEAL_II_EXPAND_PETSC_MPI_BLOCKVECTOR "PETScWrappers::MPI::BlockVector")
 ENDMACRO()
 
 
index 5dd027d482929c502f76e73fcd242dd18d55b1ec..c86c9612f0a89f57949a9293b527e876147f1a3c 100644 (file)
@@ -22,7 +22,6 @@ MACRO(FEATURE_HDF5_FIND_EXTERNAL var)
   FIND_PACKAGE(HDF5)
 
   IF(HDF5_FOUND)
-
     IF( (HDF5_WITH_MPI AND DEAL_II_WITH_MPI) OR
         (NOT HDF5_WITH_MPI AND NOT DEAL_II_WITH_MPI) )
       SET(${var} TRUE)
@@ -38,19 +37,8 @@ MACRO(FEATURE_HDF5_FIND_EXTERNAL var)
         "  DEAL_II_WITH_MPI = ${DEAL_II_WITH_MPI}\n"
         "  HDF5_WITH_MPI    = ${HDF5_WITH_MPI}\n"
         )
-      UNSET(HDF5_HL_LIBRARY CACHE)
-      UNSET(HDF5_INCLUDE_DIR CACHE)
-      UNSET(HDF5_LIBRARY CACHE)
-      UNSET(HDF5_PUBCONF CACHE)
     ENDIF()
   ENDIF()
 ENDMACRO()
 
-
 CONFIGURE_FEATURE(HDF5)
-
-
-#
-# The user has to know the location of the hdf5 headers as well:
-#
-SET(HDF5_USER_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
index a02e94d0b97d6e5856ac254e580a622e494d74e3..78b4bb0b008ae9d47f49a18c44b51fed8d72c344 100644 (file)
 
 SET(FEATURE_MUMPS_DEPENDS DEAL_II_WITH_MPI DEAL_II_WITH_LAPACK)
 
-
 CONFIGURE_FEATURE(MUMPS)
-
-#
-# The user has to know the location of the MUMPS headers as well:
-#
-SET(MUMPS_USER_INCLUDE_DIRS ${MUMPS_INCLUDE_DIRS})
index a54643b60cd34f3566206f6d882e87037742e985..967b10b5657be7d85899e9abf6ef47ef14e418e2 100644 (file)
@@ -54,30 +54,8 @@ MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
         )
       SET(${var} FALSE)
     ENDIF()
-
-    #
-    # Reset configuration:
-    #
-    IF(NOT ${var})
-      UNSET(P4EST_LIBRARY_OPTIMIZED CACHE)
-      UNSET(P4EST_LIBRARY_DEBUG CACHE)
-      UNSET(P4EST_INCLUDE_DIR CACHE)
-      UNSET(SC_LIBRARY_OPTIMIZED CACHE)
-      UNSET(SC_LIBRARY_DEBUG CACHE)
-      UNSET(SC_INCLUDE_DIR CACHE)
-      SET(P4EST_DIR "" CACHE PATH
-        "An optional hint to a p4est installation/directory"
-        )
-      MARK_AS_ADVANCED(CLEAR P4EST_DIR)
-    ENDIF()
-
   ENDIF()
 ENDMACRO()
 
 
 CONFIGURE_FEATURE(P4EST)
-
-#
-# The user has to know the location of the P4est headers as well:
-#
-SET(P4EST_USER_INCLUDE_DIRS ${P4EST_INCLUDE_DIRS})
index a4b97958fc6323c706107c04a5171efad9035513..1f98ed4ecb8ad855335d52a8d5cf595ccbe96f36 100644 (file)
@@ -78,8 +78,3 @@ ENDMACRO()
 
 
 CONFIGURE_FEATURE(SLEPC)
-
-#
-# The user has to know the location of the SLEPC headers as well:
-#
-SET(SLEPC_USER_INCLUDE_DIRS ${SLEPC_INCLUDE_DIRS})
index 60930bf7bf34eed22107366fcf59289945ec416c..fa76a34841ca117bc5e38d88223b4ce110f12515 100644 (file)
@@ -195,6 +195,7 @@ MACRO(CONFIGURE_FEATURE _feature)
             "DEAL_II_WITH_${_feature} has unmet configuration requirements: "
             "${_dependency} has to be set to \"ON\"."
             )
+          PURGE_FEATURE(${_feature})
           SET_CACHED_OPTION(${_feature} OFF)
         ENDIF()
         SET(_dependencies_ok FALSE)
@@ -206,6 +207,9 @@ MACRO(CONFIGURE_FEATURE _feature)
         #
         # First case: DEAL_II_FORCE_BUNDLED_${_feature} is defined:
         #
+
+        PURGE_FEATURE(${_feature})
+
         IF(FEATURE_${_feature}_HAVE_BUNDLED)
           RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_BUNDLED()")
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} successfully set up with bundled packages.")
@@ -241,6 +245,8 @@ MACRO(CONFIGURE_FEATURE _feature)
 
         ELSE(FEATURE_${_feature}_EXTERNAL_FOUND)
 
+          PURGE_FEATURE(${_feature})
+
           MESSAGE(STATUS "DEAL_II_WITH_${_feature} has unmet external dependencies.")
 
           IF(FEATURE_${_feature}_HAVE_BUNDLED AND DEAL_II_ALLOW_BUNDLED)
@@ -272,6 +278,7 @@ MACRO(CONFIGURE_FEATURE _feature)
     # DEAL_II_WITH_${_feature} is defined and set to OFF, promote it to
     # cache nevertheless:
     #
+    PURGE_FEATURE(${_feature})
     SET_CACHED_OPTION(${_feature} OFF)
   ENDIF()
 
index 4472f74c6142ca5f375a246f5302eb78b42d4b15..8fa5e6142dd4cb6b92f23899bf8060c1617042dc 100644 (file)
@@ -56,7 +56,6 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature _var)
   SET(${_feature}_FOUND TRUE)
 
   SET(_variable ${_var})
-  SET(_cleanup ${_var})
   SET(${_feature}_${_variable} "")
   SET(_required TRUE)
   SET(_fine TRUE)
@@ -82,7 +81,6 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature _var)
       # *Yay* a new keyword.
       #
       SET(_variable ${_arg})
-      LIST(APPEND _cleanup ${_var})
       SET(${_feature}_${_variable} "")
       SET(_required TRUE)
       SET(_fine TRUE)
@@ -139,27 +137,22 @@ MACRO(DEAL_II_PACKAGE_HANDLE _feature _var)
 
   IF(${_feature}_FOUND)
     #
-    # Deduplicate entries in *_INCLUDE_DIRS and *_LIBRARIES
+    # Deduplicate entries:
     #
-    FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS)
-      REMOVE_DUPLICATES(${_feature}_${_suffix})
-    ENDFOREACH()
-    FOREACH(_suffix
-        LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG
-        USER_DEFINITIONS USER_DEFINITIONS_DEBUG USER_DEFINITIONS_RELEASE
-        DEFINITIONS DEFINITIONS_DEBUG DEFINITIONS_RELEASE
-        )
-      REMOVE_DUPLICATES(${_feature}_${_suffix} REVERSE)
+    FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES})
+      IF(_suffix MATCHES "INCLUDE_DIRS$")
+        REMOVE_DUPLICATES(${_feature}_${_suffix})
+      ELSE()
+        REMOVE_DUPLICATES(${_feature}_${_suffix} REVERSE)
+      ENDIF()
     ENDFOREACH()
 
     MESSAGE(STATUS "Found ${_feature}")
-    MARK_AS_ADVANCED(${_feature}_DIR)
+
+    MARK_AS_ADVANCED(${_feature}_DIR ${_feature}_ARCH)
 
   ELSE()
 
-    FOREACH(_v _cleanup)
-      SET(${_feature}_${_v})
-    ENDFOREACH()
     MESSAGE(STATUS "Could NOT find ${_feature}")
   ENDIF()
 ENDMACRO()
diff --git a/deal.II/cmake/macros/macro_purge_feature.cmake b/deal.II/cmake/macros/macro_purge_feature.cmake
new file mode 100644 (file)
index 0000000..3b5a493
--- /dev/null
@@ -0,0 +1,45 @@
+## ---------------------------------------------------------------------
+## $Id$
+##
+## Copyright (C) 2014 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.
+##
+## ---------------------------------------------------------------------
+
+#
+# Remove all cached and non cached variables associated with a feature.
+#
+# Usage:
+#     PURGE_FEATURE(feature)
+#
+
+MACRO(PURGE_FEATURE _feature)
+  #
+  # uncached:
+  #
+  FOREACH(_var ${DEAL_II_LIST_SUFFIXES} ${DEAL_II_STRING_SUFFIXES})
+    IF(NOT _var MATCHES BUNDLED)
+      SET(${_feature}_${_var})
+    ENDIF()
+  ENDFOREACH()
+
+  #
+  # cached:
+  #
+  FOREACH(_var ${${_feature}_CLEAR_VARIABLES})
+    SET(${_var})
+    UNSET(${_var} CACHE)
+  ENDFOREACH()
+
+  UNSET(${_feature}_CLEAR_VARIABLES CACHE)
+
+  MARK_AS_ADVANCED(CLEAR ${_feature}_DIR ${_feature}_ARCH)
+ENDMACRO()
index 1f6ed329a0c612bae2f15972b3155174ee738ce2..9fd00171906cb39431fd0e0dede651a18947ea75 100644 (file)
 # This macro will add
 #
 #   <FEATURE>_LIBRARIES (respecting general, optimized, debug keyword)
-#   <FEATURE>_LIBRARIES(_DEBUG|_RELEASE)
-#   <FEATURE>_(|BUNDLED_|USER_)INCLUDE_DIRS
-#   <FEATURE>_DEFINITIONS(|_DEBUG|_RELEASE)
-#   <FEATURE>_USER_DEFINITIONS(|_DEBUG|_RELEASE)
-#   <FEATURE>_CXX_FLAGS(|_DEBUG|_RELEASE)
-#   <FEATURE>_LINKER_FLAGS(|_DEBUG|_RELEASE)
 #
-# to the corresponding DEAL_II_* variables
+# and all other suffixes defined in DEAL_II_LIST_SUFFIXES and
+# DEAL_II_STRING_SUFFIXES to the corresponding DEAL_II_* variables
 #
 
 MACRO(REGISTER_FEATURE _feature)
@@ -63,21 +58,13 @@ MACRO(REGISTER_FEATURE _feature)
     ENDFOREACH()
   ENDIF()
 
-  FOREACH(_var
-    LIBRARIES_DEBUG LIBRARIES_RELEASE
-    INCLUDE_DIRS BUNDLED_INCLUDE_DIRS USER_INCLUDE_DIRS
-    DEFINITIONS DEFINITIONS_DEBUG DEFINITIONS_RELEASE
-    USER_DEFINITIONS USER_DEFINITIONS_DEBUG USER_DEFINITIONS_RELEASE
-    )
-    IF(DEFINED ${_feature}_${_var})
+  FOREACH(_var ${DEAL_II_LIST_SUFFIXES})
+    IF(NOT "${_var}" STREQUAL "LIBRARIES" AND DEFINED ${_feature}_${_var})
       LIST(APPEND DEAL_II_${_var} ${${_feature}_${_var}})
     ENDIF()
   ENDFOREACH()
 
-  FOREACH(_var
-    CXX_FLAGS CXX_FLAGS_DEBUG CXX_FLAGS_RELEASE
-    LINKER_FLAGS LINKER_FLAGS_DEBUG LINKER_FLAGS_RELEASE
-    )
+  FOREACH(_var ${DEAL_II_STRING_SUFFIXES})
     IF(DEFINED ${_feature}_${_var})
       ADD_FLAGS(DEAL_II_${_var} "${${_feature}_${_var}}")
     ENDIF()
index ea5e594e3fab2694a9c6f3097cd3a6856f24d266..1b47573bf188a489463612ae7b3b06c02c5141e5 100644 (file)
@@ -67,5 +67,7 @@ DEAL_II_PACKAGE_HANDLE(HDF5
     OPTIONAL MPI_C_LIBRARIES
   INCLUDE_DIRS
     REQUIRED HDF5_INCLUDE_DIR
+  USER_INCLUDE_DIRS
+    REQUIRED HDF5_INCLUDE_DIR
   CLEAR HDF5_HL_LIBRARY HDF5_LIBRARY HDF5_INCLUDE_DIR HDF5_PUBCONF
   )
index 54cb744ebad1a2a3d1ecbcf10e0a59d18c5c2fb3..697e2bbec1e4245ddf60e9d38d8f90b929c7c65d 100644 (file)
@@ -56,7 +56,6 @@ FOREACH(_lib blacs blacsCinit blacsF77init)
     HINTS ${BLACS_DIR} ${SCALAPACK_DIR} ${SCALAPACK_DIR}/../blacs/
     PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB
   )
-  MARK_AS_ADVANCED(${_lib_upper}_LIBRARY)
 ENDFOREACH()
 
 #
@@ -88,11 +87,6 @@ FIND_LIBRARY(PORD_LIBRARY
   HINTS ${MUMPS_DIR}
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
-MARK_AS_ADVANCED(PORD_LIBRARY)
-IF(PORD_LIBRARY MATCHES "-NOTFOUND")
-  SET(PORD_LIBRARY "")
-  UNSET(PORD_LIBRARY CACHE)
-ENDIF()
 
 IF(EXISTS ${MUMPS_INCLUDE_DIR}/dmumps_c.h)
   FILE(STRINGS "${MUMPS_INCLUDE_DIR}/dmumps_c.h" MUMPS_VERSION_STRING
@@ -120,6 +114,8 @@ DEAL_II_PACKAGE_HANDLE(MUMPS
     OPTIONAL METIS_LIBRARIES MPI_Fortran_LIBRARIES
   INCLUDE_DIRS
     REQUIRED MUMPS_INCLUDE_DIR
+  USER_INCLUDE_DIRS
+    REQUIRED MUMPS_INCLUDE_DIR
   LINKER_FLAGS
     OPTIONAL LAPACK_LINKER_FLAGS
   CLEAR
index 3888f7973d49da5a048700cc2df8cdeb520d2997..8246a0a5aa2f426bd924dc2161bac47e8b0d3618 100644 (file)
@@ -28,8 +28,6 @@
 #   P4EST_VERSION_PATCH
 #
 
-INCLUDE(FindPackageHandleStandardArgs)
-
 SET(P4EST_DIR "" CACHE PATH
   "An optional hint to a p4est installation/directory"
   )
@@ -87,7 +85,6 @@ FIND_LIBRARY(SC_LIBRARY_DEBUG
   HINTS ${SC_DIR}/DEBUG ${P4EST_DIR}/DEBUG
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib src sc/src
   )
-MARK_AS_ADVANCED(P4EST_LIBRARY_DEBUG SC_LIBRARY_DEBUG)
 
 IF( ( "${P4EST_LIBRARY_OPTIMIZED}" STREQUAL "${P4EST_LIBRARY_DEBUG}"
       AND "${SC_LIBRARY_OPTIMIZED}" STREQUAL "${SC_LIBRARY_DEBUG}" )
@@ -156,6 +153,8 @@ DEAL_II_PACKAGE_HANDLE(P4EST
     OPTIONAL LAPACK_LIBRARIES MPI_C_LIBRARIES
   INCLUDE_DIRS
     REQUIRED P4EST_INCLUDE_DIR SC_INCLUDE_DIR
+  USER_INCLUDE_DIRS
+    REQUIRED P4EST_INCLUDE_DIR SC_INCLUDE_DIR
   CLEAR
     SC_INCLUDE_DIR P4EST_LIBRARY_OPTIMIZED SC_LIBRARY_OPTIMIZED
     P4EST_LIBRARY_DEBUG SC_LIBRARY_DEBUG P4EST_INCLUDE_DIR
index c21090fbd6269644862fd4485f5e005b78430290..574c545f3e2e1aa0ef7a74c10eff3d8c51ce1b99 100644 (file)
@@ -225,11 +225,16 @@ DEAL_II_PACKAGE_HANDLE(PETSC
   INCLUDE_DIRS
     REQUIRED PETSC_INCLUDE_DIR_COMMON PETSC_INCLUDE_DIR_ARCH
     OPTIONAL _petsc_includes
+  USER_INCLUDE_DIRS
+    REQUIRED PETSC_INCLUDE_DIR_COMMON PETSC_INCLUDE_DIR_ARCH
+    OPTIONAL _petsc_includes
   CLEAR
     PETSC_LIBRARY PETSC_INCLUDE_DIR_COMMON PETSC_INCLUDE_DIR_ARCH
-    ${_cleanup_variables}
+    PETSC_PETSCVARIABLES ${_cleanup_variables}
   )
 
 IF(PETSC_FOUND)
   MARK_AS_ADVANCED(PETSC_ARCH)
+ELSE()
+  MARK_AS_ADVANCED(CLEAR PETSC_ARCH)
 ENDIF()
index b558e7a39ee17e86ac258adb68f80129df6d3b49..f328927bdbd52d3525887df69dbd42efa647dcf8 100644 (file)
@@ -95,5 +95,7 @@ DEAL_II_PACKAGE_HANDLE(SLEPC
     REQUIRED SLEPC_LIBRARY PETSC_LIBRARIES
   INCLUDE_DIRS
     REQUIRED SLEPC_INCLUDE_DIR_ARCH SLEPC_INCLUDE_DIR_COMMON
+  USER_INCLUDE_DIRS
+    REQUIRED SLEPC_INCLUDE_DIR_ARCH SLEPC_INCLUDE_DIR_COMMON
   CLEAR SLEPC_LIBRARY SLEPC_INCLUDE_DIR_ARCH SLEPC_INCLUDE_DIR_COMMON
   )
index d2f07d7a590ed0becf0982cc5cb54f7b4b2f6e53..828626cbc619d98efd305ef25029bfae44b746e5 100644 (file)
@@ -27,8 +27,6 @@
 #   TBB_VERSION_MINOR
 #
 
-INCLUDE(FindPackageHandleStandardArgs)
-
 SET(TBB_DIR "" CACHE PATH "An optional hint to a TBB installation")
 SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}")
 
index eb1b9b568504b01f348828d76e8cc81ab7c0a68b..64a617ea482785cd6bc4c5e537ad6698fd747e50 100644 (file)
@@ -31,8 +31,6 @@
 #   TRILINOS_HAS_C99_TR1_WORKAROUND
 #
 
-INCLUDE(FindPackageHandleStandardArgs)
-
 SET(TRILINOS_DIR "" CACHE PATH "An optional hint to a Trilinos installation")
 SET_IF_EMPTY(TRILINOS_DIR "$ENV{TRILINOS_DIR}")
 
@@ -52,11 +50,15 @@ FIND_PACKAGE(TRILINOS_CONFIG
   NO_SYSTEM_ENVIRONMENT_PATH
   )
 
-IF(NOT "${TRILINOS_CONFIG_DIR}" STREQUAL "${TRILINOS_CONFIG_DIR_SAVED}")
-  SET(_new_trilinos_config TRUE)
+IF( DEFINED TRILINOS_CONFIG_DIR_SAVED AND
+    NOT "${TRILINOS_CONFIG_DIR}" STREQUAL "${TRILINOS_CONFIG_DIR_SAVED}" )
+  SET(_backup ${TRILINOS_CONFIG_DIR})
+  PURGE_FEATURE(TRILINOS)
+  SET(TRILINOS_CONFIG_DIR ${_backup} CACHE INTERNAL "")
 ENDIF()
 SET(TRILINOS_CONFIG_DIR_SAVED "${TRILINOS_CONFIG_DIR}" CACHE INTERNAL "" FORCE)
 
+
 IF(DEFINED Trilinos_VERSION)
   #
   # Extract version numbers:
@@ -79,18 +81,10 @@ ENDIF()
 #
 # Look for the one include file that we'll query for further information:
 #
-# TODO:
-IF(_new_trilinos_config)
-  UNSET(EPETRA_CONFIG_H CACHE)
-ENDIF()
 FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
   HINTS ${Trilinos_INCLUDE_DIRS}
-  NO_DEFAULT_PATH
-  NO_CMAKE_ENVIRONMENT_PATH
-  NO_CMAKE_PATH
-  NO_SYSTEM_ENVIRONMENT_PATH
-  NO_CMAKE_SYSTEM_PATH
-  NO_CMAKE_FIND_ROOT_PATH
+  NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
   )
 
 IF(EXISTS ${EPETRA_CONFIG_H})
@@ -120,6 +114,44 @@ IF(EXISTS ${EPETRA_CONFIG_H})
   ENDIF()
 ENDIF()
 
+#
+# Some versions of Sacado_cmath.hpp do things that aren't compatible
+# with the -std=c++0x flag of GCC, see deal.II FAQ.
+# Test whether that is indeed the case:
+#
+
+FIND_FILE(SACADO_CMATH_HPP Sacado_cmath.hpp
+  HINTS ${Trilinos_INCLUDE_DIRS}
+  NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH
+  )
+
+IF(EXISTS ${SACADO_CMATH_HPP})
+  LIST(APPEND CMAKE_REQUIRED_INCLUDES ${Trilinos_INCLUDE_DIRS})
+  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
+
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    #include <Sacado_cmath.hpp>
+    int main(){ return 0; }
+    "
+    TRILINOS_SUPPORTS_CPP11
+    )
+
+  #
+  # Try whether exporting HAS_C99_TR1_CMATH helps:
+  #
+  PUSH_CMAKE_REQUIRED("-DHAS_C99_TR1_CMATH")
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    #include <Sacado_cmath.hpp>
+    int main(){ return 0; }
+    "
+    TRILINOS_HAS_C99_TR1_WORKAROUND
+    )
+  RESET_CMAKE_REQUIRED()
+ENDIF()
+
 #
 # *Boy* Sanitize the include paths given by TrilinosConfig.cmake...
 #
@@ -135,10 +167,7 @@ STRING(REGEX REPLACE
 #
 SET(_libraries "")
 FOREACH(_library ${Trilinos_LIBRARIES})
-  IF(_new_trilinos_config)
-    UNSET(TRILINOS_LIBRARY_${_library} CACHE)
-  ENDIF()
-
+  LIST(APPEND _libraries TRILINOS_LIBRARY_${_library})
   FIND_LIBRARY(TRILINOS_LIBRARY_${_library}
     NAMES ${_library}
     HINTS ${Trilinos_LIBRARY_DIRS}
@@ -149,55 +178,18 @@ FOREACH(_library ${Trilinos_LIBRARIES})
     NO_CMAKE_SYSTEM_PATH
     NO_CMAKE_FIND_ROOT_PATH
     )
-
-  LIST(APPEND _libraries TRILINOS_LIBRARY_${_library})
 ENDFOREACH()
 
+
 DEAL_II_PACKAGE_HANDLE(TRILINOS
   LIBRARIES
     REQUIRED ${_libraries} Trilinos_TPL_LIBRARIES
     OPTIONAL MPI_CXX_LIBRARIES
   INCLUDE_DIRS
     REQUIRED Trilinos_INCLUDE_DIRS
-  CLEAR TRILINOS_CONFIG EPETRA_CONFIG_H ${_libraries}
+  USER_INCLUDE_DIRS
+    REQUIRED Trilinos_INCLUDE_DIRS
+  CLEAR
+    TRILINOS_CONFIG_DIR EPETRA_CONFIG_H SACADO_CMATH_HPP ${_libraries}
+    TRILINOS_SUPPORTS_CPP11 TRILINOS_HAS_C99_TR1_WORKAROUND
   )
-
-IF(TRILINOS_FOUND)
-  #
-  # Some versions of Sacado_cmath.hpp do things that aren't compatible
-  # with the -std=c++0x flag of GCC, see deal.II FAQ.
-  # Test whether that is indeed the case:
-  #
-  IF(_new_trilinos_config)
-    UNSET(TRILINOS_SUPPORTS_CPP11 CACHE)
-    UNSET(TRILINOS_HAS_C99_TR1_WORKAROUND CACHE)
-  ENDIF()
-
-  LIST(APPEND CMAKE_REQUIRED_INCLUDES ${TRILINOS_INCLUDE_DIRS})
-  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX11_FLAG}")
-
-  CHECK_CXX_SOURCE_COMPILES(
-    "
-    #include <Sacado_cmath.hpp>
-    int main(){ return 0; }
-    "
-    TRILINOS_SUPPORTS_CPP11
-    )
-
-  #
-  # Try whether exporting HAS_C99_TR1_CMATH helps:
-  #
-  PUSH_CMAKE_REQUIRED("-DHAS_C99_TR1_CMATH")
-  CHECK_CXX_SOURCE_COMPILES(
-    "
-    #include <Sacado_cmath.hpp>
-    int main(){ return 0; }
-    "
-    TRILINOS_HAS_C99_TR1_WORKAROUND
-    )
-  RESET_CMAKE_REQUIRED()
-
-ELSE()
-
-  UNSET(TRILINOS_CONFIG_DIR_SAVED CACHE)
-ENDIF()
index 7a42e42a9ebc7b10e074fc93173734a1ee2fc541..9db0d3546fefb79ae844a24d1cb891853e1c9849 100644 (file)
@@ -28,8 +28,6 @@
 #   UMFPACK_VERSION_SUBMINOR
 #
 
-INCLUDE(FindPackageHandleStandardArgs)
-
 SET(UMFPACK_DIR "" CACHE PATH "An optional hint to an UMFPACK directory")
 SET(SUITESPARSE_DIR "" CACHE PATH
   "An optional hint to a SUITESPARSE directory"
@@ -146,6 +144,7 @@ ENDIF()
 # by ldd :-( ):
 #
 FIND_SYSTEM_LIBRARY(rt_LIBRARY NAMES rt)
+MARK_AS_ADVANCED(rt_LIBRARY)
 
 DEAL_II_PACKAGE_HANDLE(UMFPACK
   LIBRARIES
@@ -160,12 +159,12 @@ DEAL_II_PACKAGE_HANDLE(UMFPACK
     OPTIONAL LAPACK_LINKER_FLAGS
   CLEAR
     UMFPACK_LIBRARY CHOLMOD_LIBRARY CCOLAMD_LIBRARY COLAMD_LIBRARY
-    CAMD_LIBRARY SuiteSparse_config_LIBRARY AMD_LIBRARY METIS_LIBRARIES
-    LAPACK_LIBRARIES UMFPACK_INCLUDE_DIR AMD_INCLUDE_DIR
-    SuiteSparse_config_INCLUDE_DIR
+    CAMD_LIBRARY SuiteSparse_config_LIBRARY AMD_LIBRARY UMFPACK_INCLUDE_DIR
+    AMD_INCLUDE_DIR SuiteSparse_config_INCLUDE_DIR
   )
 
 IF(UMFPACK_FOUND)
   MARK_AS_ADVANCED(SUITESPARSE_DIR)
+ELSE()
+  MARK_AS_ADVANCED(CLEAR SUITESPARSE_DIR)
 ENDIF()
-MARK_AS_ADVANCED(SuiteSparse_config_LIBRARY rt_LIBRARY)
index 777c066931d4dcddd88cbcc5a6eac4a14e7b3236..6ef18d05cbd405e45678b766f159974add0314d0 100644 (file)
@@ -52,6 +52,8 @@
 #     DEAL_II_PROJECT_CONFIG_RELDIR   *)
 #
 #     DEAL_II_BUILD_TYPES
+#     DEAL_II_LIST_SUFFIXES
+#     DEAL_II_STRING_SUFFIXES
 #
 # *)  Can be overwritten by the command line via -D<...>
 #
@@ -134,6 +136,18 @@ IF(CMAKE_BUILD_TYPE MATCHES "Release")
   LIST(APPEND DEAL_II_BUILD_TYPES "RELEASE")
 ENDIF()
 
+SET(DEAL_II_LIST_SUFFIXES
+  DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG
+  USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG
+  INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS
+  LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG
+  )
+
+SET(DEAL_II_STRING_SUFFIXES
+  CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG
+  LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG
+  )
+
 
 ########################################################################
 #                                                                      #
index 4d228ea4ae8670eacd4be89124464af633b41aa1..a568672b895175c406c08dfb48b9bf7da6a862e1 100644 (file)
@@ -55,14 +55,7 @@ ENDFOREACH()
 # Save base configuration into variables BASE_* for later use in
 # setup_write_config.cmake:
 #
-FOREACH(_suffix
-  CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG
-  DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG
-  USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG
-  LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG
-  INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS
-  LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG
-  )
+FOREACH(_suffix ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES})
   SET(BASE_${_suffix} ${DEAL_II_${_suffix}})
 ENDFOREACH()
 
@@ -70,22 +63,19 @@ ENDFOREACH()
 # Register features:
 #
 FOREACH(_feature ${DEAL_II_FEATURES})
-  FILTER_SYSTEM_LIBRARIES(${_feature})
+  FILTER_SYSTEM_LIBRARIES(${_feature}) # TODO, remove here
   REGISTER_FEATURE(${_feature})
 ENDFOREACH()
 
 #
 # Deduplicate entries one more time :-]
 #
-FOREACH(_suffix INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS)
-  REMOVE_DUPLICATES(DEAL_II_${_suffix})
-ENDFOREACH()
-FOREACH(_suffix
-  LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG
-  USER_DEFINITIONS USER_DEFINITIONS_DEBUG USER_DEFINITIONS_RELEASE
-  DEFINITIONS DEFINITIONS_DEBUG DEFINITIONS_RELEASE
-  )
-  REMOVE_DUPLICATES(DEAL_II_${_suffix} REVERSE)
+FOREACH(_suffix ${DEAL_II_LIST_SUFFIXES})
+  IF(_suffix MATCHES "INCLUDE_DIRS$")
+    REMOVE_DUPLICATES(DEAL_II_${_suffix})
+  ELSE()
+    REMOVE_DUPLICATES(DEAL_II_${_suffix} REVERSE)
+  ENDIF()
 ENDFOREACH()
 
 #
index 1afca5ff200c8780d04d343661f0e20799d92e4b..6acc88aefa84536c1d0c73a72434bb6db48f9843 100644 (file)
@@ -199,13 +199,8 @@ FOREACH(_var ${_features})
     # Print the feature configuration:
     #
     FOREACH(_var2
-        C_COMPILER CXX_COMPILER Fortran_COMPILER
-        CXX_FLAGS CXX_FLAGS_RELEASE CXX_FLAGS_DEBUG
-        DEFINITIONS DEFINITIONS_RELEASE DEFINITIONS_DEBUG
-        USER_DEFINITIONS USER_DEFINITIONS_RELEASE USER_DEFINITIONS_DEBUG
-        LINKER_FLAGS LINKER_FLAGS_RELEASE LINKER_FLAGS_DEBUG
-        INCLUDE_DIRS USER_INCLUDE_DIRS BUNDLED_INCLUDE_DIRS
-        LIBRARIES LIBRARIES_RELEASE LIBRARIES_DEBUG
+      C_COMPILER CXX_COMPILER Fortran_COMPILER
+      ${DEAL_II_STRING_SUFFIXES} ${DEAL_II_LIST_SUFFIXES}
       )
       IF(DEFINED ${_feature}_${_var2})
         _detailed("#            ${_feature}_${_var2} = ${${_feature}_${_var2}}\n")

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.