diff options
Diffstat (limited to 'cmake/modules/FindCurl.cmake')
| -rw-r--r-- | cmake/modules/FindCurl.cmake | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index d0759a6..17c1f01 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake | |||
| @@ -34,40 +34,6 @@ if(CURL_FOUND) | |||
| 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) | 34 | set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) |
| 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) | 35 | set(CURL_LIBRARIES ${CURL_LIBRARY}) |
| 36 | 36 | ||
| 37 | # Check whether OpenSSL inside libcurl is static. | ||
| 38 | if(UNIX) | ||
| 39 | if(NOT DEFINED HAS_CURL_STATIC) | ||
| 40 | get_filename_component(CURL_LIBRARY_DIR ${CURL_LIBRARY} DIRECTORY) | ||
| 41 | find_soname(CURL REQUIRED) | ||
| 42 | |||
| 43 | if(APPLE) | ||
| 44 | set(libchecker nm) | ||
| 45 | set(searchpattern "T [_]?CRYPTO_set_locking_call") | ||
| 46 | else() | ||
| 47 | set(libchecker readelf -s) | ||
| 48 | set(searchpattern "CRYPTO_set_locking_call") | ||
| 49 | endif() | ||
| 50 | execute_process( | ||
| 51 | COMMAND ${libchecker} ${CURL_LIBRARY_DIR}/${CURL_SONAME} | ||
| 52 | COMMAND grep -Eq ${searchpattern} | ||
| 53 | RESULT_VARIABLE HAS_CURL_STATIC) | ||
| 54 | unset(libchecker) | ||
| 55 | unset(searchpattern) | ||
| 56 | if(HAS_CURL_STATIC EQUAL 0) | ||
| 57 | set(HAS_CURL_STATIC TRUE) | ||
| 58 | else() | ||
| 59 | set(HAS_CURL_STATIC FALSE) | ||
| 60 | endif() | ||
| 61 | set(HAS_CURL_STATIC ${HAS_CURL_STATIC} CACHE INTERNAL | ||
| 62 | "OpenSSL is statically linked into Curl") | ||
| 63 | message(STATUS "OpenSSL is statically linked into Curl: ${HAS_CURL_STATIC}") | ||
| 64 | endif() | ||
| 65 | endif() | ||
| 66 | |||
| 67 | if(HAS_CURL_STATIC) | ||
| 68 | set(CURL_DEFINITIONS -DHAS_CURL_STATIC=1) | ||
| 69 | endif() | ||
| 70 | |||
| 71 | if(NOT TARGET Curl::Curl) | 37 | if(NOT TARGET Curl::Curl) |
| 72 | add_library(Curl::Curl UNKNOWN IMPORTED) | 38 | add_library(Curl::Curl UNKNOWN IMPORTED) |
| 73 | set_target_properties(Curl::Curl PROPERTIES | 39 | set_target_properties(Curl::Curl PROPERTIES |
