From: maier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Date: Thu, 3 Oct 2013 22:06:49 +0000 (+0000)
Subject: Bugfix: Only include libparmetis to the link interface if its likely that it belongs... 
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af8e3dd90646a5ab61535ff2e4ddeae665417033;p=dealii-svn.git

Bugfix: Only include libparmetis to the link interface if its likely that it belongs to the metis library..


git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31107 0785d39b-7218-0410-832d-ea1e28bc413d
---

diff --git a/deal.II/cmake/modules/FindMETIS.cmake b/deal.II/cmake/modules/FindMETIS.cmake
index 29c9be531f..005905aecc 100644
--- a/deal.II/cmake/modules/FindMETIS.cmake
+++ b/deal.II/cmake/modules/FindMETIS.cmake
@@ -78,7 +78,14 @@ MARK_AS_ADVANCED(
 
 IF(METIS_FOUND)
 
-  IF(NOT PARMETIS_LIBRARY MATCHES "-NOTFOUND")
+  #
+  # 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()