]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: FindTRILINOS.cmake: Drop /.../include/scotch from include dirs 1457/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 28 Aug 2015 20:36:01 +0000 (15:36 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 28 Aug 2015 21:12:02 +0000 (16:12 -0500)
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*

cmake/modules/FindTRILINOS.cmake

index acc46a0f142a874af0d3113337ed8fceaba8ce31..a9a5918d183e01be3e01fd4c4d496369564ab83a 100644 (file)
@@ -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...

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.