2017-02-28 23:51:22 +00:00
|
|
|
find_package(PkgConfig QUIET)
|
|
|
|
pkg_check_modules(PC_CURL libcurl)
|
|
|
|
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_lib(CURL curl)
|
2017-02-28 23:51:22 +00:00
|
|
|
find_library(CURL_LIBRARY
|
|
|
|
NAMES curl
|
2017-07-31 16:30:24 +00:00
|
|
|
HINTS ${HINTS_CURL_LIBDIR} ${PC_CURL_LIBDIR} ${PC_CURL_LIBRARY_DIRS}
|
|
|
|
PATHS ${PATHS_CURL_LIBDIR}
|
2017-02-28 23:51:22 +00:00
|
|
|
)
|
2017-10-24 10:10:46 +00:00
|
|
|
set_extra_dirs_include(CURL curl "${CURL_LIBRARY}")
|
|
|
|
find_path(CURL_INCLUDEDIR curl/curl.h
|
|
|
|
HINTS ${HINTS_CURL_INCLUDEDIR} ${PC_CURL_INCLUDEDIR} ${PC_CURL_INCLUDE_DIRS}
|
|
|
|
PATHS ${PATHS_CURL_INCLUDEDIR}
|
|
|
|
)
|
2017-02-23 13:16:32 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2017-02-28 23:51:22 +00:00
|
|
|
find_package_handle_standard_args(Curl DEFAULT_MSG CURL_LIBRARY CURL_INCLUDEDIR)
|
|
|
|
|
|
|
|
mark_as_advanced(CURL_LIBRARY CURL_INCLUDEDIR)
|
|
|
|
|
|
|
|
set(CURL_LIBRARIES ${CURL_LIBRARY})
|
|
|
|
set(CURL_INCLUDE_DIRS ${CURL_INCLUDEDIR})
|
2017-03-07 14:24:08 +00:00
|
|
|
|
|
|
|
string(FIND "${CURL_LIBRARY}" "${PROJECT_SOURCE_DIR}" LOCAL_PATH_POS)
|
|
|
|
if(LOCAL_PATH_POS EQUAL 0 AND TARGET_OS STREQUAL "windows")
|
|
|
|
set(CURL_COPY_FILES
|
2017-07-21 21:43:01 +00:00
|
|
|
"${EXTRA_CURL_LIBDIR}/libcurl.dll"
|
2017-03-07 14:24:08 +00:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
set(CURL_COPY_FILES)
|
|
|
|
endif()
|