diff options
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 330dccf83..769f264e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "-") |