From c5c3c64a40ee2e477d527755d9373fbd994e5daa Mon Sep 17 00:00:00 2001 From: ManifoldFR Date: Tue, 7 May 2024 23:53:35 +0200 Subject: [PATCH] FindCHOLMOD : check if CHOLMOD target exists before trying to import --- find-external/CHOLMOD/FindCHOLMOD.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-external/CHOLMOD/FindCHOLMOD.cmake b/find-external/CHOLMOD/FindCHOLMOD.cmake index ea3a05ed4..a403b88b0 100644 --- a/find-external/CHOLMOD/FindCHOLMOD.cmake +++ b/find-external/CHOLMOD/FindCHOLMOD.cmake @@ -93,7 +93,7 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(CHOLMOD DEFAULT_MSG CHOLMOD_INCLUDES CHOLMOD_LIBRARIES CHOLMOD_DEPENDENCIES) -if(CHOLMOD_LIBRARIES) +if(CHOLMOD_LIBRARIES AND NOT TARGET CHOLMOD::CHOLMOD) add_library(CHOLMOD::CHOLMOD SHARED IMPORTED) set_target_properties( CHOLMOD::CHOLMOD @@ -107,7 +107,7 @@ if(CHOLMOD_LIBRARIES) set_target_properties(CHOLMOD::CHOLMOD PROPERTIES IMPORTED_LOCATION_RELEASE "${CHOLMOD_LIBRARIES}") endif() -endif(CHOLMOD_LIBRARIES) +endif() mark_as_advanced( CHOLMOD_INCLUDES