Merge topic 'improve-findcurl'
0640ec9
FindCURL: detect version number also for older versions
This commit is contained in:
commit
ba96356434
|
@ -34,11 +34,16 @@ FIND_LIBRARY(CURL_LIBRARY NAMES
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CURL_LIBRARY)
|
MARK_AS_ADVANCED(CURL_LIBRARY)
|
||||||
|
|
||||||
IF(CURL_INCLUDE_DIR AND EXISTS "${CURL_INCLUDE_DIR}/curl/curlver.h")
|
IF(CURL_INCLUDE_DIR)
|
||||||
FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/curlver.h" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
|
FOREACH(_curl_version_header curlver.h curl.h)
|
||||||
|
IF(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
|
||||||
|
FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
|
||||||
|
|
||||||
STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
|
STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}")
|
||||||
UNSET(curl_version_str)
|
UNSET(curl_version_str)
|
||||||
|
BREAK()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH(_curl_version_header)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
|
||||||
|
|
Loading…
Reference in New Issue