Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
ba963564
Commit
ba963564
authored
Feb 01, 2012
by
David Cole
Committed by
Kitware Robot
Feb 01, 2012
Browse files
Options
Browse Files
Download
Plain Diff
Merge topic 'improve-findcurl'
0640ec94
FindCURL: detect version number also for older versions
parents
3f7cea09
0640ec94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Modules/FindCURL.cmake
Modules/FindCURL.cmake
+9
-4
No files found.
Modules/FindCURL.cmake
View file @
ba963564
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment