]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Refactor Find modules
authorMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 26 Apr 2014 13:31:38 +0000 (13:31 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 26 Apr 2014 13:31:38 +0000 (13:31 +0000)
git-svn-id: https://svn.dealii.org/trunk@32844 0785d39b-7218-0410-832d-ea1e28bc413d

15 files changed:
deal.II/cmake/macros/macro_configure_feature.cmake
deal.II/cmake/modules/FindARPACK.cmake
deal.II/cmake/modules/FindDEALII_LAPACK.cmake
deal.II/cmake/modules/FindHDF5.cmake
deal.II/cmake/modules/FindMETIS.cmake
deal.II/cmake/modules/FindMUMPS.cmake
deal.II/cmake/modules/FindMUPARSER.cmake
deal.II/cmake/modules/FindNETCDF.cmake
deal.II/cmake/modules/FindP4EST.cmake
deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/modules/FindSCALAPACK.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

index 219ab2f40586488d2832a9a5bab6203ff71cb5c6..60930bf7bf34eed22107366fcf59289945ec416c 100644 (file)
@@ -230,8 +230,6 @@ MACRO(CONFIGURE_FEATURE _feature)
         ENDIF()
 
         IF(FEATURE_${_feature}_EXTERNAL_FOUND)
-          MESSAGE(STATUS "All external dependencies for DEAL_II_WITH_${_feature} are fullfilled.")
-
           IF(COMMAND FEATURE_${_feature}_CONFIGURE_EXTERNAL)
             RUN_COMMAND("FEATURE_${_feature}_CONFIGURE_EXTERNAL()")
           ENDIF()
index 61af946b969f76516ee43444b47f0540f5109352..cd2c9bcef0fc13d2d84edae278355bf844700909 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index 69a24aed6c7a2f674268cd2547a9afb994d99a61..8b2dff588e7e1965ee8c2b298d98b99aa463aa99 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2013 by the deal.II authors
+## Copyright (C) 2013 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index b3437c99526b9056db37d9c1fd3b7e644b01f73b..73cb833302815269ba7ff3e9a24fc6425c9a9c21 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index a5d9e2ab18fad3d811052dd51e87a1f09cead867..0accb210fa68649238442aaf253223071a2fa3f2 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -39,13 +39,6 @@ SET_IF_EMPTY(METIS_DIR "$ENV{METIS_DIR}")
 # Link in MPI unconditionally (if found).
 #
 
-FIND_PATH(METIS_INCLUDE_DIR metis.h
-  HINTS
-    ${METIS_DIR}
-  PATH_SUFFIXES
-    metis include/metis include
-  )
-
 FIND_LIBRARY(METIS_LIBRARY
   NAMES metis
   HINTS
@@ -56,45 +49,30 @@ FIND_LIBRARY(METIS_LIBRARY
     build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
   )
 
+#
+# Sanity check: Only search the parmetis library in the same directory as
+# the metis library...
+#
+GET_FILENAME_COMPONENT(_path "${METIS_LIBRARY}" PATH)
 FIND_LIBRARY(PARMETIS_LIBRARY
   NAMES parmetis
+  HINTS ${_path}
+  NO_DEFAULT_PATH
+  NO_CMAKE_ENVIRONMENT_PATH
+  NO_CMAKE_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH
+  NO_CMAKE_SYSTEM_PATH
+  NO_CMAKE_FIND_ROOT_PATH
+  )
+
+FIND_PATH(METIS_INCLUDE_DIR metis.h
   HINTS
     ${METIS_DIR}
   PATH_SUFFIXES
-    lib${LIB_SUFFIX} lib64 lib
-    # This is a hint, isn't it?
-    build/${CMAKE_CXX_PLATFORM_ID}-${CMAKE_SYSTEM_PROCESSOR}/libmetis
-  )
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG
-  METIS_LIBRARY
-  METIS_INCLUDE_DIR
-  )
-
-MARK_AS_ADVANCED(
-  METIS_LIBRARY
-  PARMETIS_LIBRARY
-  METIS_INCLUDE_DIR
+    metis include/metis include
   )
 
-IF(METIS_FOUND)
-  #
-  # Sanity check: Only include parmetis library if it is in the same
-  # directory as the metis library...
-  #
-  GET_FILENAME_COMPONENT(_path1 "${PARMETIS_LIBRARY}" PATH)
-  GET_FILENAME_COMPONENT(_path2 "${ETIS_LIBRARY}" PATH)
-  IF( NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND"
-      AND "${_path1}" STREQUAL "${_path2}" )
-    SET(METIS_LIBRARIES ${PARMETIS_LIBRARY})
-  ENDIF()
-
-  LIST(APPEND METIS_LIBRARIES
-    ${METIS_LIBRARY}
-    ${MPI_C_LIBRARIES} # for good measure
-    )
-  SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
-
+IF(EXISTS ${METIS_INCLUDE_DIR}/metis.h)
   #
   # Extract the version number out of metis.h
   #
@@ -119,6 +97,31 @@ IF(METIS_FOUND)
   SET(METIS_VERSION
     "${METIS_VERSION_MAJOR}.${METIS_VERSION_MINOR}.${METIS_VERSION_SUBMINOR}"
     )
+ENDIF()
+
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG
+  METIS_LIBRARY
+  METIS_INCLUDE_DIR
+  )
+
+MARK_AS_ADVANCED(
+  METIS_LIBRARY
+  PARMETIS_LIBRARY
+  METIS_INCLUDE_DIR
+  )
+
+IF(METIS_FOUND)
+
+  IF(NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND")
+    SET(METIS_LIBRARIES ${PARMETIS_LIBRARY})
+  ENDIF()
+
+  LIST(APPEND METIS_LIBRARIES
+    ${METIS_LIBRARY}
+    ${MPI_C_LIBRARIES} # for good measure
+    )
+  SET(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR})
 
   MARK_AS_ADVANCED(METIS_DIR)
 ENDIF()
index f8de1f5154a8ce1cb350afdeea3b45737db61a3a..db55daab2f28066977073c189a552cc2d1aabd28 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index d9d15635d12bb46bac255855416eaced1e624c84..060ec2fe7aec0331228275b11a3a6d27a8dd1f87 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2013 by the deal.II authors
+## Copyright (C) 2013 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -43,15 +43,7 @@ FIND_PATH(MUPARSER_INCLUDE_DIR muParserDef.h
   PATH_SUFFIXES include
   )
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUPARSER DEFAULT_MSG
-  MUPARSER_LIBRARY
-  MUPARSER_INCLUDE_DIR
-  )
-
-IF(MUPARSER_FOUND)
-  SET(MUPARSER_LIBRARIES ${MUPARSER_LIBRARY})
-  SET(MUPARSER_INCLUDE_DIRS ${MUPARSER_INCLUDE_DIR})
-
+IF(EXISTS ${MUPARSER_INCLUDE_DIR}/muParserDef.h)
   FILE(STRINGS "${MUPARSER_INCLUDE_DIR}/muParserDef.h" MUPARSER_VERSION_STRING
     REGEX "#define MUP_VERSION _T"
     )
@@ -67,6 +59,16 @@ IF(MUPARSER_FOUND)
   SET(MUPARSER_VERSION
     "${MUPARSER_VERSION_MAJOR}.${MUPARSER_VERSION_MINOR}.${MUPARSER_VERSION_SUBMINOR}"
     )
+ENDIF()
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MUPARSER DEFAULT_MSG
+  MUPARSER_LIBRARY
+  MUPARSER_INCLUDE_DIR
+  )
+
+IF(MUPARSER_FOUND)
+  SET(MUPARSER_LIBRARIES ${MUPARSER_LIBRARY})
+  SET(MUPARSER_INCLUDE_DIRS ${MUPARSER_INCLUDE_DIR})
 
   MARK_AS_ADVANCED(MUPARSER_DIR)
 ENDIF()
index 3ab2650229896701744739f3de91358d9ffcd082..5ee129ec46b465464f4129010172efad011f2038 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index db72bb22681125075d517d254b713697a1ef7dbb..4104e6952dbd16b66d424d3a9c5fc1d9dfb3210e 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -41,15 +41,6 @@ SET_IF_EMPTY(SC_DIR "$ENV{SC_DIR}")
 # given, take what we chose for p4est.
 #
 
-FIND_PATH(P4EST_INCLUDE_DIR p4est_config.h
-  HINTS
-    ${P4EST_DIR}/FAST
-    ${P4EST_DIR}/DEBUG
-    ${P4EST_DIR}
-  PATH_SUFFIXES
-    p4est include/p4est include src
-  )
-
 FIND_PATH(SC_INCLUDE_DIR sc.h
   HINTS
     ${SC_DIR}/FAST
@@ -102,6 +93,58 @@ FIND_LIBRARY(SC_LIBRARY_DEBUG
     lib${LIB_SUFFIX} lib64 lib src sc/src
   )
 
+FIND_PATH(P4EST_INCLUDE_DIR p4est_config.h
+  HINTS
+    ${P4EST_DIR}/FAST
+    ${P4EST_DIR}/DEBUG
+    ${P4EST_DIR}
+  PATH_SUFFIXES
+    p4est include/p4est include src
+  )
+
+IF(EXISTS ${P4EST_INCLUDE_DIR}/p4est_config.h)
+  #
+  # Determine mpi support of p4est:
+  #
+  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
+    REGEX "#define.*P4EST_MPI 1")
+  IF("${P4EST_MPI_STRING}" STREQUAL "")
+    SET(P4EST_WITH_MPI FALSE)
+  ELSE()
+    SET(P4EST_WITH_MPI TRUE)
+  ENDIF()
+
+  #
+  # Extract version numbers:
+  #
+  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VERSION
+    REGEX "#define P4EST_VERSION \"")
+  STRING(REGEX REPLACE "^.*P4EST_VERSION.*\"([0-9]+.*)\".*" "\\1"
+    P4EST_VERSION "${P4EST_VERSION}"
+    )
+  STRING(REGEX REPLACE
+    "^([0-9]+).*$" "\\1"
+    P4EST_VERSION_MAJOR "${P4EST_VERSION}")
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.([0-9]+).*$" "\\1"
+    P4EST_VERSION_MINOR "${P4EST_VERSION}")
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    P4EST_VERSION_SUBMINOR "${P4EST_VERSION}")
+
+  # Now for the patch number such as in 0.3.4.1. If there
+  # is no patch number, then the REGEX REPLACE will fail,
+  # setting P4EST_VERSION_PATCH to P4EST_VERSION. If that
+  # is the case, then set the patch number to zero
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)?.*$" "\\1"
+    P4EST_VERSION_PATCH "${P4EST_VERSION}")
+  IF(${P4EST_VERSION_PATCH} STREQUAL "${P4EST_VERSION}")
+    SET(P4EST_VERSION_PATCH "0")
+  ENDIF()
+ENDIF()
+
+
 SET(_output ${P4EST_LIBRARY_OPTMIZED} ${SC_LIBRARY_OPTIMIZED})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(P4EST DEFAULT_MSG
   _output # Cosmetic: Gives nice output
@@ -153,45 +196,5 @@ IF(P4EST_FOUND)
     ${SC_INCLUDE_DIR}
     )
 
-  #
-  # Determine mpi support of p4est:
-  #
-  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_MPI_STRING
-    REGEX "#define.*P4EST_MPI 1")
-  IF("${P4EST_MPI_STRING}" STREQUAL "")
-    SET(P4EST_WITH_MPI FALSE)
-  ELSE()
-    SET(P4EST_WITH_MPI TRUE)
-  ENDIF()
-
-  #
-  # Extract version numbers:
-  #
-  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VERSION
-    REGEX "#define P4EST_VERSION \"")
-  STRING(REGEX REPLACE "^.*P4EST_VERSION.*\"([0-9]+.*)\".*" "\\1"
-    P4EST_VERSION "${P4EST_VERSION}"
-    )
-  STRING(REGEX REPLACE
-    "^([0-9]+).*$" "\\1"
-    P4EST_VERSION_MAJOR "${P4EST_VERSION}")
-  STRING(REGEX REPLACE
-    "^[0-9]+\\.([0-9]+).*$" "\\1"
-    P4EST_VERSION_MINOR "${P4EST_VERSION}")
-  STRING(REGEX REPLACE
-    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
-    P4EST_VERSION_SUBMINOR "${P4EST_VERSION}")
-
-  # Now for the patch number such as in 0.3.4.1. If there
-  # is no patch number, then the REGEX REPLACE will fail,
-  # setting P4EST_VERSION_PATCH to P4EST_VERSION. If that
-  # is the case, then set the patch number to zero
-  STRING(REGEX REPLACE
-    "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)?.*$" "\\1"
-    P4EST_VERSION_PATCH "${P4EST_VERSION}")
-  IF(${P4EST_VERSION_PATCH} STREQUAL "${P4EST_VERSION}")
-    SET(P4EST_VERSION_PATCH "0")
-  ENDIF()
-
   MARK_AS_ADVANCED(P4EST_DIR)
 ENDIF()
index 242a510d902d9dc2acc45a9e2e4db6a8c7f5ca98..be222bcaf12b1b89ae35462b68f701d068630eb4 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -62,6 +62,42 @@ FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h
   PATH_SUFFIXES petsc include include/petsc
 )
 
+SET(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h")
+IF(EXISTS ${PETSC_PETSCCONF_H})
+  #
+  # Is petsc compiled with support for MPIUNI?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_MPIUNI_STRING
+    REGEX "#define.*PETSC_HAVE_MPIUNI 1")
+  IF("${PETSC_MPIUNI_STRING}" STREQUAL "")
+    SET(PETSC_WITH_MPIUNI FALSE)
+  ELSE()
+    SET(PETSC_WITH_MPIUNI TRUE)
+  ENDIF()
+
+  #
+  # Is petsc compiled with support for 64BIT_INDICES?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_64BIT_INDICES_STRING
+    REGEX "#define.*PETSC_USE_64BIT_INDICES 1")
+  IF("${PETSC_64BIT_INDICES_STRING}" STREQUAL "")
+    SET(PETSC_WITH_64BIT_INDICES FALSE)
+  ELSE()
+    SET(PETSC_WITH_64BIT_INDICES TRUE)
+  ENDIF()
+
+  #
+  # Is petsc compiled with support for COMPLEX numbers?
+  #
+  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING
+    REGEX "#define.*PETSC_USE_COMPLEX 1")
+  IF("${PETSC_COMPLEX_STRING}" STREQUAL "")
+    SET(PETSC_WITH_COMPLEX FALSE)
+  ELSE()
+    SET(PETSC_WITH_COMPLEX TRUE)
+  ENDIF()
+ENDIF()
+
 #
 # Sometimes, this is not enough...
 # If petsc is not installed but in source tree layout, there will be
@@ -84,6 +120,33 @@ FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h
   PATH_SUFFIXES petsc include include/petsc
 )
 
+SET(PETSC_PETSCVERSION_H "${PETSC_INCLUDE_DIR_COMMON}/petscversion.h")
+IF(EXISTS ${PETSC_PETSCVERSION_H})
+  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
+    REGEX "#define.*PETSC_VERSION_MAJOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
+    PETSC_VERSION_MAJOR "${PETSC_VERSION_MAJOR_STRING}"
+    )
+  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MINOR_STRING
+    REGEX "#define.*PETSC_VERSION_MINOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_MINOR.*([0-9]+).*" "\\1"
+    PETSC_VERSION_MINOR "${PETSC_VERSION_MINOR_STRING}"
+    )
+  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_SUBMINOR_STRING
+    REGEX "#define.*PETSC_VERSION_SUBMINOR")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_SUBMINOR.*([0-9]+).*" "\\1"
+    PETSC_VERSION_SUBMINOR "${PETSC_VERSION_SUBMINOR_STRING}"
+    )
+  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_PATCH_STRING
+    REGEX "#define.*PETSC_VERSION_PATCH")
+  STRING(REGEX REPLACE "^.*PETSC_VERSION_PATCH.*([0-9]+).*" "\\1"
+    PETSC_VERSION_PATCH "${PETSC_VERSION_PATCH_STRING}"
+    )
+  SET(PETSC_VERSION
+    "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}.${PETSC_VERSION_PATCH}"
+    )
+ENDIF()
+
 #
 # So, up to this point it was easy. Now, the tricky part. Search for
 # petscvariables and determine the includes and the link interface from
@@ -99,7 +162,6 @@ FIND_FILE(PETSC_PETSCVARIABLES
   )
 
 IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
-
   #
   # Includes:
   #
@@ -191,70 +253,6 @@ IF(PETSC_FOUND)
     ${_petsc_includes}
     )
 
-  SET(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h")
-  SET(PETSC_PETSCVERSION_H "${PETSC_INCLUDE_DIR_COMMON}/petscversion.h")
-
-  #
-  # Is petsc compiled with support for MPIUNI?
-  #
-  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_MPIUNI_STRING
-    REGEX "#define.*PETSC_HAVE_MPIUNI 1")
-  IF("${PETSC_MPIUNI_STRING}" STREQUAL "")
-    SET(PETSC_WITH_MPIUNI FALSE)
-  ELSE()
-    SET(PETSC_WITH_MPIUNI TRUE)
-  ENDIF()
-
-  #
-  # Is petsc compiled with support for 64BIT_INDICES?
-  #
-  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_64BIT_INDICES_STRING
-    REGEX "#define.*PETSC_USE_64BIT_INDICES 1")
-  IF("${PETSC_64BIT_INDICES_STRING}" STREQUAL "")
-    SET(PETSC_WITH_64BIT_INDICES FALSE)
-  ELSE()
-    SET(PETSC_WITH_64BIT_INDICES TRUE)
-  ENDIF()
-
-  #
-  # Is petsc compiled with support for COMPLEX numbers?
-  #
-  FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_COMPLEX_STRING
-    REGEX "#define.*PETSC_USE_COMPLEX 1")
-  IF("${PETSC_COMPLEX_STRING}" STREQUAL "")
-    SET(PETSC_WITH_COMPLEX FALSE)
-  ELSE()
-    SET(PETSC_WITH_COMPLEX TRUE)
-  ENDIF()
-
-  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MAJOR_STRING
-    REGEX "#define.*PETSC_VERSION_MAJOR")
-  STRING(REGEX REPLACE "^.*PETSC_VERSION_MAJOR.*([0-9]+).*" "\\1"
-    PETSC_VERSION_MAJOR "${PETSC_VERSION_MAJOR_STRING}"
-    )
-
-  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_MINOR_STRING
-    REGEX "#define.*PETSC_VERSION_MINOR")
-  STRING(REGEX REPLACE "^.*PETSC_VERSION_MINOR.*([0-9]+).*" "\\1"
-    PETSC_VERSION_MINOR "${PETSC_VERSION_MINOR_STRING}"
-    )
-
-  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_SUBMINOR_STRING
-    REGEX "#define.*PETSC_VERSION_SUBMINOR")
-  STRING(REGEX REPLACE "^.*PETSC_VERSION_SUBMINOR.*([0-9]+).*" "\\1"
-    PETSC_VERSION_SUBMINOR "${PETSC_VERSION_SUBMINOR_STRING}"
-    )
-
-  FILE(STRINGS "${PETSC_PETSCVERSION_H}" PETSC_VERSION_PATCH_STRING
-    REGEX "#define.*PETSC_VERSION_PATCH")
-  STRING(REGEX REPLACE "^.*PETSC_VERSION_PATCH.*([0-9]+).*" "\\1"
-    PETSC_VERSION_PATCH "${PETSC_VERSION_PATCH_STRING}"
-    )
-
-  SET(PETSC_VERSION
-    "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}.${PETSC_VERSION_PATCH}"
-    )
-
   MARK_AS_ADVANCED(PETSC_ARCH PETSC_DIR)
 ENDIF()
 
index 9d91be55a6ab03f86cf3ace94438b45d404c846f..57fad7cecb8da3e865c723d5bc9a5d15846129d9 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
index d65e6f41a125b0f3f1a76df9b2125da2bd216167..51c612831808ee04345681450fdd16bf545d4b4e 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -70,40 +70,13 @@ FIND_PATH(SLEPC_INCLUDE_DIR_COMMON slepcversion.h
   PATH_SUFFIXES slepc include include/slepc
 )
 
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SLEPC DEFAULT_MSG
-  SLEPC_LIBRARY
-  SLEPC_INCLUDE_DIR_ARCH
-  SLEPC_INCLUDE_DIR_COMMON
-  PETSC_FOUND
-  )
-
-MARK_AS_ADVANCED(
-  SLEPC_DIR
-  SLEPC_INCLUDE_DIR_ARCH
-  SLEPC_INCLUDE_DIR_COMMON
-  SLEPC_INCLUDE_DIRS
-  SLEPC_LIBRARY
-  )
-
-IF(SLEPC_FOUND)
-  SET(SLEPC_INCLUDE_DIRS
-    ${SLEPC_INCLUDE_DIR_ARCH}
-    ${SLEPC_INCLUDE_DIR_COMMON}
-    )
-  SET(SLEPC_LIBRARIES
-    ${SLEPC_LIBRARY}
-    ${PETSC_LIBRARIES}
-    )
-
-  SET(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h")
-
+SET(SLEPC_SLEPCVERSION_H "${SLEPC_INCLUDE_DIR_COMMON}/slepcversion.h")
+IF(EXISTS ${SLEPC_SLEPCVERSION_H})
   FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MAJOR_STRING
     REGEX "#define.*SLEPC_VERSION_MAJOR")
   STRING(REGEX REPLACE "^.*SLEPC_VERSION_MAJOR.*([0-9]+).*" "\\1"
     SLEPC_VERSION_MAJOR "${SLEPC_VERSION_MAJOR_STRING}"
     )
-
   FILE(STRINGS "${SLEPC_SLEPCVERSION_H}" SLEPC_VERSION_MINOR_STRING
     REGEX "#define.*SLEPC_VERSION_MINOR")
   STRING(REGEX REPLACE "^.*SLEPC_VERSION_MINOR.*([0-9]+).*" "\\1"
@@ -121,11 +94,35 @@ IF(SLEPC_FOUND)
   STRING(REGEX REPLACE "^.*SLEPC_VERSION_PATCH.*([0-9]+).*" "\\1"
     SLEPC_VERSION_PATCH "${SLEPC_VERSION_PATCH_STRING}"
     )
-
   SET(SLEPC_VERSION
     "${SLEPC_VERSION_MAJOR}.${SLEPC_VERSION_MINOR}.${SLEPC_VERSION_SUBMINOR}.${SLEPC_VERSION_PATCH}"
     )
+ENDIF()
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SLEPC DEFAULT_MSG
+  SLEPC_LIBRARY
+  SLEPC_INCLUDE_DIR_ARCH
+  SLEPC_INCLUDE_DIR_COMMON
+  PETSC_FOUND
+  )
 
+MARK_AS_ADVANCED(
+  SLEPC_DIR
+  SLEPC_INCLUDE_DIR_ARCH
+  SLEPC_INCLUDE_DIR_COMMON
+  SLEPC_INCLUDE_DIRS
+  SLEPC_LIBRARY
+  )
+
+IF(SLEPC_FOUND)
+  SET(SLEPC_INCLUDE_DIRS
+    ${SLEPC_INCLUDE_DIR_ARCH}
+    ${SLEPC_INCLUDE_DIR_COMMON}
+    )
+  SET(SLEPC_LIBRARIES
+    ${SLEPC_LIBRARY}
+    ${PETSC_LIBRARIES}
+    )
   MARK_AS_ADVANCED(SLEPC_DIR)
 ENDIF()
 
index 354f968074ba6e1543587e09c648c3223456a0ee..0efd5ef3517336d8d2bcc1a3ffddddd7c3996a36 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -32,14 +32,7 @@ INCLUDE(FindPackageHandleStandardArgs)
 SET(TBB_DIR "" CACHE PATH "An optional hint to a TBB installation")
 SET_IF_EMPTY(TBB_DIR "$ENV{TBB_DIR}")
 
-FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h
-  HINTS
-    ${TBB_DIR}
-  PATH_SUFFIXES include include/tbb tbb
-  )
-
 FILE(GLOB _path ${TBB_DIR}/build/*_release)
-
 FIND_LIBRARY(TBB_LIBRARY
   NAMES tbb
   HINTS
@@ -49,7 +42,6 @@ FIND_LIBRARY(TBB_LIBRARY
   )
 
 FILE(GLOB _path ${TBB_DIR}/build/*_debug)
-
 FIND_LIBRARY(TBB_DEBUG_LIBRARY
   NAMES tbb_debug
   HINTS
@@ -58,29 +50,33 @@ FIND_LIBRARY(TBB_DEBUG_LIBRARY
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
 
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
-  TBB_LIBRARY
-  TBB_INCLUDE_DIR
+FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h
+  HINTS
+    ${TBB_DIR}
+  PATH_SUFFIXES include include/tbb tbb
   )
 
-IF(NOT TBB_INCLUDE_DIR MATCHES "-NOTFOUND")
+IF(EXISTS ${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h)
   FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING
     REGEX "#define.*TBB_VERSION_MAJOR")
   STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR.*([0-9]+).*" "\\1"
     TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}"
     )
-
   FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING
     REGEX "#define.*TBB_VERSION_MINOR")
   STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR.*([0-9]+).*" "\\1"
     TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}"
     )
-
   SET(TBB_VERSION
     "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}"
     )
 ENDIF()
 
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
+  TBB_LIBRARY
+  TBB_INCLUDE_DIR
+  )
+
 MARK_AS_ADVANCED(
   TBB_LIBRARY
   TBB_DEBUG_LIBRARY
index edb94438d455ecf6cbc0b9ba7962356c425f06dc..fa266cce44183fca9301d153f8e7a7075683b60a 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -57,6 +57,24 @@ IF(NOT "${TRILINOS_CONFIG_DIR}" STREQUAL "${TRILINOS_CONFIG_DIR_SAVED}")
 ENDIF()
 SET(TRILINOS_CONFIG_DIR_SAVED "${TRILINOS_CONFIG_DIR}" CACHE INTERNAL "" FORCE)
 
+IF(DEFINED Trilinos_VERSION)
+  #
+  # Extract version numbers:
+  #
+  SET(TRILINOS_VERSION "${Trilinos_VERSION}")
+
+  STRING(REGEX REPLACE
+    "^([0-9]+).*$" "\\1"
+    TRILINOS_VERSION_MAJOR "${Trilinos_VERSION}")
+
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.([0-9]+).*$" "\\1"
+    TRILINOS_VERSION_MINOR "${Trilinos_VERSION}")
+
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
+ENDIF()
 
 #
 # Look for the one include file that we'll query for further information:
@@ -74,6 +92,32 @@ FIND_FILE(EPETRA_CONFIG_H Epetra_config.h
   NO_CMAKE_FIND_ROOT_PATH
   )
 
+IF(EXISTS ${EPETRA_CONFIG_H})
+  #
+  # Determine whether Trilinos was configured with MPI and 64bit indices:
+  #
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_MPI_STRING
+    REGEX "#define HAVE_MPI")
+  IF("${EPETRA_MPI_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_MPI FALSE)
+  ELSE()
+    SET(TRILINOS_WITH_MPI TRUE)
+  ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING
+    REGEX "#define EPETRA_NO_32BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE)
+  ENDIF()
+  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING
+    REGEX "#define EPETRA_NO_64BIT_GLOBAL_INDICES")
+  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
+    SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE)
+  ELSE()
+    SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE)
+  ENDIF()
+ENDIF()
 
 #
 # *Boy* Sanitize the include paths given by TrilinosConfig.cmake...
@@ -131,47 +175,6 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TRILINOS DEFAULT_MSG
 MARK_AS_ADVANCED(TRILINOS_CONFIG_DIR EPETRA_CONFIG_H)
 
 IF(TRILINOS_FOUND)
-  #
-  # Extract version numbers:
-  #
-  SET(TRILINOS_VERSION "${Trilinos_VERSION}")
-
-  STRING(REGEX REPLACE
-    "^([0-9]+).*$" "\\1"
-    TRILINOS_VERSION_MAJOR "${Trilinos_VERSION}")
-
-  STRING(REGEX REPLACE
-    "^[0-9]+\\.([0-9]+).*$" "\\1"
-    TRILINOS_VERSION_MINOR "${Trilinos_VERSION}")
-
-  STRING(REGEX REPLACE
-    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
-    TRILINOS_VERSION_SUBMINOR "${Trilinos_VERSION}")
-
-  #
-  # Determine whether Trilinos was configured with MPI and 64bit indices:
-  #
-  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_MPI_STRING
-    REGEX "#define HAVE_MPI")
-  IF("${EPETRA_MPI_STRING}" STREQUAL "")
-    SET(TRILINOS_WITH_MPI FALSE)
-  ELSE()
-    SET(TRILINOS_WITH_MPI TRUE)
-  ENDIF()
-  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_32BIT_STRING
-    REGEX "#define EPETRA_NO_32BIT_GLOBAL_INDICES")
-  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
-    SET(TRILINOS_WITH_NO_32BITS_INDICES TRUE)
-  ELSE()
-    SET(TRILINOS_WITH_NO_32BITS_INDICES FALSE)
-  ENDIF()
-  FILE(STRINGS "${EPETRA_CONFIG_H}" EPETRA_64BIT_STRING
-    REGEX "#define EPETRA_NO_64BIT_GLOBAL_INDICES")
-  IF("${EPETRA_64BIT_STRING}" STREQUAL "")
-    SET(TRILINOS_WITH_NO_64BITS_INDICES TRUE)
-  ELSE()
-    SET(TRILINOS_WITH_NO_64BITS_INDICES FALSE)
-  ENDIF()
 
   #
   # Some versions of Sacado_cmath.hpp do things that aren't compatible
index 9db454866386412d73d2ec84d794c8a4ed983d43..96f52592247ee0ce3c8892aeb0f749e338d8ddfd 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2012 - 2013 by the deal.II authors
+## Copyright (C) 2012 - 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##

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.