From: Matthias Maier Date: Fri, 28 Aug 2015 20:36:01 +0000 (-0500) Subject: CMake: FindTRILINOS.cmake: Drop /.../include/scotch from include dirs X-Git-Tag: v8.4.0-rc2~532^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1457%2Fhead;p=dealii.git CMake: FindTRILINOS.cmake: Drop /.../include/scotch from include dirs scotch has the very unfortunate bad habit of containing a header file /usr/include/scotch/metis.h If above directory is in our list of include directories, we will accidentally pick up this header instead of /usr/include/metis.h I assume it is safe to drop /usr/include/scotch/, this should be only internally used in Trilinos... Further, deduplicate library and include directory lists. *wow* --- diff --git a/cmake/modules/FindTRILINOS.cmake b/cmake/modules/FindTRILINOS.cmake index acc46a0f14..a9a5918d18 100644 --- a/cmake/modules/FindTRILINOS.cmake +++ b/cmake/modules/FindTRILINOS.cmake @@ -150,13 +150,31 @@ IF(EXISTS ${SACADO_CMATH_HPP}) ENDIF() # -# *Boy* Sanitize the include paths given by TrilinosConfig.cmake... +# *Boy* Sanitize variables that are exported by TrilinosConfig.cmake... # +# Especially deduplicate stuff... +# +REMOVE_DUPLICATES(Trilinos_LIBRARIES REVERSE) +REMOVE_DUPLICATES(Trilinos_TPL_LIBRARIES REVERSE) + +REMOVE_DUPLICATES(Trilinos_INCLUDE_DIRS) STRING(REGEX REPLACE "(lib64|lib)\\/cmake\\/Trilinos\\/\\.\\.\\/\\.\\.\\/\\.\\.\\/" "" Trilinos_INCLUDE_DIRS "${Trilinos_INCLUDE_DIRS}" ) +REMOVE_DUPLICATES(Trilinos_TPL_INCLUDE_DIRS) + +# +# workaround: Do not pull in scotch include directory. It clashes with +# our use of the metis headers... +# +FOREACH(_item ${Trilinos_TPL_INCLUDE_DIRS}) + IF("${_item}" MATCHES "scotch$") + LIST(REMOVE_ITEM Trilinos_TPL_INCLUDE_DIRS ${_item}) + ENDIF() +ENDFOREACH() + # # We'd like to have the full library names but the Trilinos package only # exports a list with short names...