From dab3387c9c90cc6ddc180271a7b8d2e62225b535 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Tue, 10 Mar 2026 15:46:22 +0100 Subject: [PATCH] COMP: Ensure CURL find package is found using CONFIG modules of our cURL --- patch/Libs/RemoteIO/CMakeLists.txt | 3 +-- patch/SuperBuild/External_curl.cmake | 17 ++--------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/patch/Libs/RemoteIO/CMakeLists.txt b/patch/Libs/RemoteIO/CMakeLists.txt index 43c3d10..b557c5c 100644 --- a/patch/Libs/RemoteIO/CMakeLists.txt +++ b/patch/Libs/RemoteIO/CMakeLists.txt @@ -42,8 +42,7 @@ vtk_module_add_module(Slicer::RemoteIO HEADERS ${wrapper_header_file} ) -vtk_module_link(Slicer::RemoteIO PUBLIC vtkAddon PRIVATE ${CURL_LIBRARIES} ZLIB::ZLIB) -vtk_module_include(Slicer::RemoteIO PRIVATE ${CURL_INCLUDE_DIRS}) +vtk_module_link(Slicer::RemoteIO PUBLIC vtkAddon PRIVATE CURL::libcurl_static ZLIB::ZLIB) if(WIN32) # Define CURL_STATICLIB when linking against static curl on Windows diff --git a/patch/SuperBuild/External_curl.cmake b/patch/SuperBuild/External_curl.cmake index 82241df..7127c1f 100644 --- a/patch/SuperBuild/External_curl.cmake +++ b/patch/SuperBuild/External_curl.cmake @@ -109,19 +109,7 @@ if((NOT DEFINED CURL_INCLUDE_DIR ExternalProject_GenerateProjectDescription_Step(${proj}) - if(UNIX) - set(curl_IMPORT_SUFFIX .a) - if(APPLE) - set(curl_IMPORT_SUFFIX .a) - endif() - elseif(WIN32) - set(curl_IMPORT_SUFFIX .lib) - else() - message(FATAL_ERROR "Unknown system !") - endif() - - set(CURL_INCLUDE_DIR "${EP_INSTALL_DIR}/include") - set(CURL_LIBRARY "${EP_INSTALL_DIR}/lib/libcurl${curl_IMPORT_SUFFIX}") + set(CURL_DIR "${EP_INSTALL_DIR}/lib/cmake/CURL") else() ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES}) @@ -129,8 +117,7 @@ endif() mark_as_superbuild( VARS - CURL_INCLUDE_DIR:PATH - CURL_LIBRARY:FILEPATH + CURL_DIR:PATH LABELS "FIND_PACKAGE" )