From 5f360716264e0346d38ca07c22225564851d9823 Mon Sep 17 00:00:00 2001 From: Justin Carpentier Date: Sun, 11 Feb 2024 23:04:07 +0100 Subject: [PATCH] external/cholmod: fix finder --- find-external/CHOLMOD/findCHOLMOD.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/find-external/CHOLMOD/findCHOLMOD.cmake b/find-external/CHOLMOD/findCHOLMOD.cmake index 2fe0c6f76..48a80e335 100644 --- a/find-external/CHOLMOD/findCHOLMOD.cmake +++ b/find-external/CHOLMOD/findCHOLMOD.cmake @@ -26,7 +26,7 @@ if(CHOLMOD_LIBRARIES) find_library(AMD_LIBRARY amd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(AMD_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${AMD_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${AMD_LIBRARY}) else() set(CHOLMOD_LIBRARIES FALSE) endif() @@ -38,7 +38,7 @@ if(CHOLMOD_LIBRARIES) find_library(COLAMD_LIBRARY colamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(COLAMD_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${COLAMD_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${COLAMD_LIBRARY}) else() set(CHOLMOD_LIBRARIES FALSE) endif() @@ -50,7 +50,7 @@ if(CHOLMOD_LIBRARIES) find_library(CAMD_LIBRARY camd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(CAMD_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CAMD_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${CAMD_LIBRARY}) else() set(CHOLMOD_LIBRARIES FALSE) endif() @@ -62,7 +62,7 @@ if(CHOLMOD_LIBRARIES) find_library(CCOLAMD_LIBRARY ccolamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(CCOLAMD_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CCOLAMD_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${CCOLAMD_LIBRARY}) else() set(CHOLMOD_LIBRARIES FALSE) endif() @@ -74,7 +74,7 @@ if(CHOLMOD_LIBRARIES) find_library(CHOLMOD_METIS_LIBRARY metis PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(CHOLMOD_METIS_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CHOLMOD_METIS_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${CHOLMOD_METIS_LIBRARY}) endif() endif() @@ -84,20 +84,21 @@ if(CHOLMOD_LIBRARIES) find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR}) if(SUITESPARSE_LIBRARY) - set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${SUITESPARSE_LIBRARY}) + list(APPEND CHOLMOD_DEPENDENCIES ${SUITESPARSE_LIBRARY}) endif() endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CHOLMOD DEFAULT_MSG CHOLMOD_INCLUDES - CHOLMOD_LIBRARIES) + CHOLMOD_LIBRARIES CHOLMOD_DEPENDENCIES) if(CHOLMOD_LIBRARIES) add_library(CHOLMOD::CHOLMOD SHARED IMPORTED) set_target_properties( CHOLMOD::CHOLMOD - PROPERTIES IMPORTED_LOCATION ${CHOLMOD_LIBRARIES} + PROPERTIES IMPORTED_LOCATION "${CHOLMOD_LIBRARIES}" + INTERFACE_LINK_LIBRARIES ${CHOLMOD_DEPENDENCIES} INTERFACE_INCLUDE_DIRECTORIES "${CHOLMOD_INCLUDES}") endif(CHOLMOD_LIBRARIES)