diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-06-07 14:08:03 -0700 |
---|---|---|
committer | Feng Xiao <xiaofeng@google.com> | 2016-06-07 14:08:03 -0700 |
commit | 6aa981f94975d8619552d7f709632a79a1680e4f (patch) | |
tree | d21f711c9568bf271a3310f654cbbb8f747fb1a6 /cmake/CMakeLists.txt | |
parent | dfe0c9ad3836dc3756a908fa0e4aee1c2b3f2ce1 (diff) | |
parent | 0420eab17301ee7baebaf3e1e08a08a24c7c432e (diff) | |
download | protobuf-6aa981f94975d8619552d7f709632a79a1680e4f.tar.gz protobuf-6aa981f94975d8619552d7f709632a79a1680e4f.tar.bz2 protobuf-6aa981f94975d8619552d7f709632a79a1680e4f.zip |
Merge pull request #1624 from yeswalrus/cmake-prerelease-versioning
CMake prerelease versioning
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r-- | cmake/CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5004270f..7e1b385e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -51,17 +51,24 @@ string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2" string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3" protobuf_CONTACT "${protobuf_AC_INIT_LINE}") # Parse version tweaks -set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*$") +set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)$") string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1" protobuf_VERSION_MAJOR "${protobuf_VERSION_STRING}") string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\2" protobuf_VERSION_MINOR "${protobuf_VERSION_STRING}") string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\3" protobuf_VERSION_PATCH "${protobuf_VERSION_STRING}") +string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\4" + protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}") + # Package version set(protobuf_VERSION "${protobuf_VERSION_MAJOR}.${protobuf_VERSION_MINOR}.${protobuf_VERSION_PATCH}") +if(protobuf_VERSION_PRERELEASE) + set(protobuf_VERSION "${protobuf_VERSION}-${protobuf_VERSION_PRERELEASE}") +endif() + if(protobuf_VERBOSE) message(STATUS "Configuration script parsing status [") message(STATUS " Description : ${protobuf_DESCRIPTION}") |