From 057b8a61d61c3d6f81316014c34d139fe4d3f9f4 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 18 Aug 2020 09:56:50 +0300 Subject: [PATCH] Use CURL::libcurl imported target when available When built with CMake, CURL installation includes configuration package that could be used instead of CMake-bundled find module. The former doesn't define CURL_INCLUDE_DIRS and CURL_LIBRARIES variables, but only imported targets. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 319e23328..7803dc104 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,6 +135,10 @@ find_package(Threads) find_package(PkgConfig QUIET) find_package(CURL ${CURL_MINIMUM} REQUIRED) +if(TARGET CURL::libcurl) + set(CURL_LIBRARIES CURL::libcurl) + set(CURL_INCLUDE_DIRS) +endif() find_package(ICONV)