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.
This commit is contained in:
Mike Gelfand 2020-08-18 09:56:50 +03:00
parent b8a02fdfb3
commit 057b8a61d6
1 changed files with 4 additions and 0 deletions

View File

@ -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)