mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
ENH: extract version from curlver.h
This commit is contained in:
parent
5d502eb90c
commit
5c4b6a8ef0
@ -22,15 +22,31 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
|
||||
include(Utilities)
|
||||
|
||||
project( CURL C )
|
||||
set(CURL_MAJOR_VERSION 7)
|
||||
set(CURL_MINOR_VERSION 19)
|
||||
set(CURL_PATCH_VERSION 4)
|
||||
|
||||
|
||||
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})
|
||||
|
||||
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")
|
||||
# SET(PACKAGE_VERSION "-")
|
||||
|
Loading…
Reference in New Issue
Block a user