diff --git a/cmake/FindGKLIB.cmake b/cmake/FindGKLIB.cmake index 1796cf6e3..b5d28e318 100644 --- a/cmake/FindGKLIB.cmake +++ b/cmake/FindGKLIB.cmake @@ -7,12 +7,13 @@ set_target_properties(GKLIB::GKLIB PROPERTIES IMPORTED_LOCATION "${gklib_lib}" INTERFACE_INCLUDE_DIRECTORIES "${gklib_inc}") -## Finalize find_package include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - ${CMAKE_FIND_PACKAGE_NAME} - REQUIRED_VARS gklib_lib - gklib_inc) - -message(STATUS "Found GKLIB: ${gklib_lib}") +if(gklib_inc MATCHES "NOTFOUND" OR gklib_lib MATCHES "NOTFOUND") + set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False) +else() + find_package_handle_standard_args( + ${CMAKE_FIND_PACKAGE_NAME} + REQUIRED_VARS gklib_lib + gklib_inc) +endif() diff --git a/cmake/FindMETIS.cmake b/cmake/FindMETIS.cmake index 9f7f423f1..fdc464494 100644 --- a/cmake/FindMETIS.cmake +++ b/cmake/FindMETIS.cmake @@ -1,15 +1,19 @@ find_library(metis_lib NAMES libmetis.a libmetis.so libmetis.dylib HINTS ENV METIS_PATH PATH_SUFFIXES lib) find_path(metis_inc metis.h HINTS ENV METIS_PATH PATH_SUFFIXES include) -find_package(GKLIB REQUIRED) - add_library(METIS::METIS STATIC IMPORTED) set_target_properties(METIS::METIS PROPERTIES IMPORTED_LOCATION "${metis_lib}" INTERFACE_INCLUDE_DIRECTORIES "${metis_inc}") -target_link_libraries(METIS::METIS INTERFACE GKLIB::GKLIB) +find_package(GKLIB) +if(NOT GKLIB_FOUND) + message(STATUS "GKLIB not found") + target_link_libraries(METIS::METIS) +else() + target_link_libraries(METIS::METIS INTERFACE GKLIB::GKLIB) +endif() ## Finalize find_package include(FindPackageHandleStandardArgs) @@ -18,5 +22,3 @@ find_package_handle_standard_args( ${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS metis_lib metis_inc) - -message(STATUS "Found METIS: ${metis_lib}") diff --git a/cmake/FindParMETIS.cmake b/cmake/FindParMETIS.cmake index d1b78b928..089c11cd5 100644 --- a/cmake/FindParMETIS.cmake +++ b/cmake/FindParMETIS.cmake @@ -18,5 +18,3 @@ find_package_handle_standard_args( ${CMAKE_FIND_PACKAGE_NAME} REQUIRED_VARS parmetis_lib parmetis_inc) - -message(STATUS "Found ParMETIS: ${parmetis_lib}")