]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Bugfix: Get the caching right in FindPETSC.cmake and
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 2 Feb 2014 00:10:11 +0000 (00:10 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 2 Feb 2014 00:10:11 +0000 (00:10 +0000)
FindTRILINOS.cmake

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

deal.II/cmake/modules/FindPETSC.cmake
deal.II/cmake/modules/FindTRILINOS.cmake

index 7bd039a11c02d1c8d180e589269f35fa61204f81..df83255e4d98371a2608545a69317b454924452f 100644 (file)
@@ -123,13 +123,18 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
   # Link line:
   #
 
-  FILE(STRINGS "${PETSC_PETSCVARIABLES}" _external_link_line
+  FILE(STRINGS "${PETSC_PETSCVARIABLES}" PETSC_EXTERNAL_LINK_LINE
     REGEX "^PETSC_WITH_EXTERNAL_LIB =.*")
-  SEPARATE_ARGUMENTS(_external_link_line)
+  SEPARATE_ARGUMENTS(PETSC_EXTERNAL_LINK_LINE)
+
+  IF(NOT "${PETSC_EXTERNAL_LINK_LINE}" STREQUAL "${PETSC_EXTERNAL_LINK_LINE_SAVED}")
+    SET(_new_petsc_external_link_line TRUE)
+  ENDIF()
+  SET(PETSC_EXTERNAL_LINK_LINE_SAVED "${PETSC_EXTERNAL_LINK_LINE}" CACHE INTERNAL "" FORCE)
 
   SET(_hints)
   SET(_petsc_libraries)
-  FOREACH(_token ${_external_link_line}})
+  FOREACH(_token ${PETSC_EXTERNAL_LINK_LINE}})
     IF(_token MATCHES "^-L")
       # Build up hints with the help of all tokens passed with -L:
       STRING(REGEX REPLACE "^-L" "" _token "${_token}")
@@ -138,14 +143,15 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
       # Search for every library that was specified with -l:
       STRING(REGEX REPLACE "^-l" "" _token "${_token}")
 
+      IF(_new_petsc_external_link_line)
+        UNSET(PETSC_LIBRARY_${_token} CACHE)
+      ENDIF()
+
       IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread)$")
         FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token})
         IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND")
           LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}})
         ENDIF()
-        # Remove from cache, so that updating PETSC search paths will
-        # find a (possibly) new link interface
-        UNSET(PETSC_LIBRARY_${_token} CACHE)
       ELSEIF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)")
         FIND_LIBRARY(PETSC_LIBRARY_${_token}
           NAMES ${_token}
@@ -154,9 +160,6 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
         IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND")
           LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}})
         ENDIF()
-        # Remove from cache, so that updating PETSC search paths will
-        # find a (possibly) new link interface
-        UNSET(PETSC_LIBRARY_${_token} CACHE)
       ENDIF()
 
     ENDIF()
@@ -164,8 +167,6 @@ IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
 
 ENDIF()
 
-
-
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG
   PETSC_LIBRARY
   PETSC_INCLUDE_DIR_ARCH
index 877e550f65487b6326f5af1d759ae5d5f3979b78..b6526cf4a3afc9834f1288107c60c78284b675d8 100644 (file)
@@ -51,10 +51,10 @@ FIND_PACKAGE(TRILINOS_CONFIG
   NO_SYSTEM_ENVIRONMENT_PATH
   )
 
-IF(NOT "${TRILINOS_CONFIG}" STREQUAL "${TRILINOS_CONFIG_SAVED}")
+IF(NOT "${TRILINOS_CONFIG_DIR}" STREQUAL "${TRILINOS_CONFIG_DIR_SAVED}")
   SET(_new_trilinos_config TRUE)
 ENDIF()
-SET(TRILINOS_CONFIG_SAVED "${TRILINOS_CONFIG}" CACHE INTERNAL "" FORCE)
+SET(TRILINOS_CONFIG_DIR_SAVED "${TRILINOS_CONFIG_DIR}" CACHE INTERNAL "" FORCE)
 
 
 #
@@ -204,17 +204,15 @@ IF(TRILINOS_FOUND)
     "
     TRILINOS_HAS_C99_TR1_WORKAROUND
     )
-
   RESET_CMAKE_REQUIRED()
 
-
   MARK_AS_ADVANCED(TRILINOS_DIR)
 
 ELSE()
 
   SET(TRILINOS_LIBRARIES)
   SET(TRILINOS_INCLUDE_DIRS)
-  SET(TRILINOS_CONFIG_SAVED "" CACHE INTERNAL "" FORCE)
+  UNSET(TRILINOS_CONFIG_DIR_SAVED CACHE)
 
   SET(TRILINOS_DIR "" CACHE PATH
     "An optional hint to a Trilinos installation"

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.