SET(_tmp_${_variable} ${${_variable}})
SET(${_variable} "")
FOREACH(_lib ${_tmp_${_variable}})
- IF(_lib MATCHES "lib(c|quadmath|gfortran|m|rt|nsl|dl|pthread|clang_rt|clang_rt.osx)\\.(a|so)$")
+ IF(_lib MATCHES "lib(c|quadmath|gfortran|m|rt|nsl|dl|pthread|clang_rt.*)\\.(a|so)$")
string(REGEX REPLACE ".*lib([a-z]+).so$" "\\1" _lib ${_lib})
ENDIF()
LIST(APPEND ${_variable} ${_lib})
FILE(STRINGS "${PETSC_PETSCVARIABLES}" PETSC_EXTERNAL_LINK_LINE
REGEX "^PETSC_WITH_EXTERNAL_LIB =.*")
+
SEPARATE_ARGUMENTS(PETSC_EXTERNAL_LINK_LINE)
SET(_hints)
SET(_petsc_libraries)
SET(_cleanup_variables)
- FOREACH(_token ${PETSC_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}")
# Search for every library that was specified with -l:
STRING(REGEX REPLACE "^-l" "" _token "${_token}")
- LIST(APPEND _cleanup_variables PETSC_LIBRARY_${_token})
+ IF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)")
+ LIST(APPEND _cleanup_variables PETSC_LIBRARY_${_token})
- IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread|clang_rt|clang_rt.osx)$")
- FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token})
- IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND")
- LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}})
+ IF(_token MATCHES "^(c|quadmath|gfortran|m|rt|nsl|dl|pthread|clang_rt.*)$")
+ FIND_SYSTEM_LIBRARY(PETSC_LIBRARY_${_token} NAMES ${_token})
+ ELSE()
+ DEAL_II_FIND_LIBRARY(PETSC_LIBRARY_${_token}
+ NAMES ${_token}
+ HINTS ${_hints}
+ )
ENDIF()
- ELSEIF(NOT _token MATCHES "(petsc|stdc\\+\\+|gcc_s)")
- DEAL_II_FIND_LIBRARY(PETSC_LIBRARY_${_token}
- NAMES ${_token}
- HINTS ${_hints}
- )
IF(NOT PETSC_LIBRARY_${_token} MATCHES "-NOTFOUND")
LIST(APPEND _petsc_libraries ${PETSC_LIBRARY_${_token}})
ENDIF()
+
ENDIF()
ENDIF()