From 2598a547b1e90908b0370e021d8fe570872a036f Mon Sep 17 00:00:00 2001 From: Lisa Julia Nebel Date: Thu, 25 Jul 2024 10:36:36 +0200 Subject: [PATCH] Correct FindMETIS.cmake - only link Scotch if IS_SCOTCH_METIS_HEADER is true --- cmake/Modules/FindMETIS.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/FindMETIS.cmake b/cmake/Modules/FindMETIS.cmake index fe6a9998cf1..b0f3173432a 100644 --- a/cmake/Modules/FindMETIS.cmake +++ b/cmake/Modules/FindMETIS.cmake @@ -88,13 +88,14 @@ if (METIS_INCLUDE_DIRS OR METIS_LIBRARY) INTERFACE_COMPILE_DEFINITIONS SCOTCH_METIS_VERSION=${METIS_API_VERSION}) endif() - if(Scotch_FOUND) + if(IS_SCOTCH_METIS_HEADER AND Scotch_FOUND) set_property(TARGET METIS::METIS APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SCOTCH_INCLUDE_DIRS}) set_property(TARGET METIS::METIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${SCOTCH_LIBRARIES}) - else() - message(FATAL_ERROR "Scotch library not found") + endif() + if(IS_SCOTCH_METIS_HEADER AND NOT Scotch_FOUND) + message(FATAL_ERROR "ScotchMETIS is installed but the Scotch library is not found!") endif() # Force our build system to use the target set(METIS_LIBRARIES METIS::METIS)