aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-10-14 11:38:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-20 17:03:58 +0200
commit8478b4035e16316f9fc2d7b7cbede51042751412 (patch)
treeef715b3e5673b696ab53177cd4f11df9c70acabf /CMakeLists.txt
parent2a2bb78cce875b803c117719defd80bcba5779e0 (diff)
downloadgnurl-8478b4035e16316f9fc2d7b7cbede51042751412.tar.gz
gnurl-8478b4035e16316f9fc2d7b7cbede51042751412.tar.bz2
gnurl-8478b4035e16316f9fc2d7b7cbede51042751412.zip
cmake: use LIBCURL_VERSION from curlver.h
This matches the behavior from autotools. The auxiliary major, minor and patch components are not needed anymore and therefore removed. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 6 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3225c2415..697ce3769 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,27 +48,17 @@ project( CURL C )
message(WARNING "the curl cmake build system is poorly maintained. Be aware")
file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS)
-string (REGEX MATCH "LIBCURL_VERSION_MAJOR[ \t]+([0-9]+)"
- LIBCURL_VERSION_MJ ${CURL_VERSION_H_CONTENTS})
-string (REGEX MATCH "([0-9]+)"
- LIBCURL_VERSION_MJ ${LIBCURL_VERSION_MJ})
-string (REGEX MATCH
- "LIBCURL_VERSION_MINOR[ \t]+([0-9]+)"
- LIBCURL_VERSION_MI ${CURL_VERSION_H_CONTENTS})
-string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_MI ${LIBCURL_VERSION_MI})
-string (REGEX MATCH
- "LIBCURL_VERSION_PATCH[ \t]+([0-9]+)"
- LIBCURL_VERSION_PT ${CURL_VERSION_H_CONTENTS})
-string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_PT ${LIBCURL_VERSION_PT})
-set (CURL_MAJOR_VERSION ${LIBCURL_VERSION_MJ})
-set (CURL_MINOR_VERSION ${LIBCURL_VERSION_MI})
-set (CURL_PATCH_VERSION ${LIBCURL_VERSION_PT})
+string (REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*"
+ CURL_VERSION ${CURL_VERSION_H_CONTENTS})
+string (REGEX REPLACE "[^\"]+\"" "" CURL_VERSION ${CURL_VERSION})
+string (REGEX MATCH "#define LIBCURL_VERSION_NUM 0x[0-9a-fA-F]+"
+ CURL_VERSION_NUM ${CURL_VERSION_H_CONTENTS})
+string (REGEX REPLACE "[^0]+0x" "" CURL_VERSION_NUM ${CURL_VERSION_NUM})
include_regular_expression("^.*$") # Sukender: Is it necessary?
# Setup package meta-data
# SET(PACKAGE "curl")
-set(CURL_VERSION ${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION})
message(STATUS "curl version=[${CURL_VERSION}]")
# SET(PACKAGE_TARNAME "curl")
# SET(PACKAGE_NAME "curl")