diff --git a/cmake/modules/curl.cmake b/cmake/modules/curl.cmake index a7c69d0db1..dacc4accb3 100644 --- a/cmake/modules/curl.cmake +++ b/cmake/modules/curl.cmake @@ -90,6 +90,7 @@ else() FILES_MATCHING PATTERN "*.h" ) + find_package(CURL REQUIRED) endif() endif() diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt index 9a0404f7e2..875b92a5d4 100644 --- a/userspace/libsinsp/CMakeLists.txt +++ b/userspace/libsinsp/CMakeLists.txt @@ -160,9 +160,15 @@ set_sinsp_target_properties(sinsp) target_link_libraries( sinsp PUBLIC scap - PRIVATE "${CURL_LIBRARIES}" "${JSONCPP_LIB}" "${RE2_LIB}" + PRIVATE ${JSONCPP_LIB} ${RE2_LIB} ) +if(NOT MINIMAL_BUILD) + if(NOT WIN32 AND NOT EMSCRIPTEN) + target_link_libraries(sinsp PRIVATE CURL::libcurl) + endif() +endif() + if(NOT EMSCRIPTEN) target_link_libraries( sinsp