diff options
| author | manuel <manuel@mausz.at> | 2019-04-29 12:22:05 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2019-04-29 12:22:05 +0200 |
| commit | e317daf081a1048904fdf0b548946fa3ba6593a7 (patch) | |
| tree | 285a58fe8c6b4a95c9a6020afbe7bcc9cb913ea7 /cmake/modules/FindCurl.cmake | |
| parent | 483c0b88bfc1b798396c31a4dd2f5239399ce59e (diff) | |
| download | kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.tar.gz kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.tar.bz2 kodi-pvr-build-e317daf081a1048904fdf0b548946fa3ba6593a7.zip | |
sync with upstream
Diffstat (limited to 'cmake/modules/FindCurl.cmake')
| -rw-r--r-- | cmake/modules/FindCurl.cmake | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index 6ccf44a..6411a92 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake | |||
| @@ -25,6 +25,19 @@ find_library(CURL_LIBRARY NAMES curl libcurl libcurl_imp | |||
| 25 | 25 | ||
| 26 | set(CURL_VERSION ${PC_CURL_VERSION}) | 26 | set(CURL_VERSION ${PC_CURL_VERSION}) |
| 27 | 27 | ||
| 28 | set(CURL_LIB_TYPE SHARED) | ||
| 29 | set(CURL_LDFLAGS ${PC_CURL_LDFLAGS}) | ||
| 30 | |||
| 31 | # check if curl is statically linked | ||
| 32 | if(${CURL_LIBRARY} MATCHES ".+\.a$" AND PC_CURL_STATIC_LDFLAGS) | ||
| 33 | set(CURL_LIB_TYPE STATIC) | ||
| 34 | set(CURL_LDFLAGS ${PC_CURL_STATIC_LDFLAGS}) | ||
| 35 | |||
| 36 | pkg_check_modules(PC_NGHTTP2 libnghttp2 QUIET) | ||
| 37 | find_library(NGHTTP2_LIBRARY NAMES libnghttp2 nghttp2 | ||
| 38 | PATHS ${PC_NGHTTP2_LIBDIR}) | ||
| 39 | endif() | ||
| 40 | |||
| 28 | include(FindPackageHandleStandardArgs) | 41 | include(FindPackageHandleStandardArgs) |
| 29 | find_package_handle_standard_args(Curl | 42 | find_package_handle_standard_args(Curl |
| 30 | REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR | 43 | REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR |
| @@ -32,10 +45,10 @@ find_package_handle_standard_args(Curl | |||
| 32 | 45 | ||
| 33 | if(CURL_FOUND) | 46 | if(CURL_FOUND) |
| 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) | 47 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) |
| 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) | 48 | set(CURL_LIBRARIES ${CURL_LIBRARY} ${NGHTTP2_LIBRARY}) |
| 36 | 49 | ||
| 37 | if(NOT TARGET Curl::Curl) | 50 | if(NOT TARGET Curl::Curl) |
| 38 | add_library(Curl::Curl UNKNOWN IMPORTED) | 51 | add_library(Curl::Curl ${CURL_LIB_TYPE} IMPORTED) |
| 39 | set_target_properties(Curl::Curl PROPERTIES | 52 | set_target_properties(Curl::Curl PROPERTIES |
| 40 | IMPORTED_LOCATION "${CURL_LIBRARY}" | 53 | IMPORTED_LOCATION "${CURL_LIBRARY}" |
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") | 54 | INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") |
| @@ -46,4 +59,4 @@ if(CURL_FOUND) | |||
| 46 | endif() | 59 | endif() |
| 47 | endif() | 60 | endif() |
| 48 | 61 | ||
| 49 | mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY) | 62 | mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY CURL_LDFLAGS) |
