diff options
author | David Cole <david.cole@kitware.com> | 2012-02-01 19:48:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-02-01 19:48:31 (GMT) |
commit | ba963564344d95e28ac2bcdf5a7d5147d1ab143a (patch) | |
tree | ef961c9782c26ff51bf7c44c7e604d851fa00159 | |
parent | 3f7cea092bd821801c69496fd22097f1eb2dba7e (diff) | |
parent | 0640ec9476c2c85e592293290d0d2dd8986af27a (diff) | |
download | CMake-ba963564344d95e28ac2bcdf5a7d5147d1ab143a.zip CMake-ba963564344d95e28ac2bcdf5a7d5147d1ab143a.tar.gz CMake-ba963564344d95e28ac2bcdf5a7d5147d1ab143a.tar.bz2 |
Merge topic 'improve-findcurl'
0640ec9 FindCURL: detect version number also for older versions
-rw-r--r-- | Modules/FindCURL.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index 517638a..cc00d53 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -34,11 +34,16 @@ FIND_LIBRARY(CURL_LIBRARY NAMES ) MARK_AS_ADVANCED(CURL_LIBRARY) -IF(CURL_INCLUDE_DIR AND EXISTS "${CURL_INCLUDE_DIR}/curl/curlver.h") - FILE(STRINGS "${CURL_INCLUDE_DIR}/curl/curlver.h" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"") +IF(CURL_INCLUDE_DIR) + 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}") - UNSET(curl_version_str) + STRING(REGEX REPLACE "^#define[\t ]+LIBCURL_VERSION[\t ]+\"([^\"]*)\".*" "\\1" CURL_VERSION_STRING "${curl_version_str}") + UNSET(curl_version_str) + BREAK() + ENDIF() + ENDFOREACH(_curl_version_header) ENDIF() # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if |