PROTON-874: update build to use point release
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/bcf01ac4 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/bcf01ac4 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/bcf01ac4 Branch: refs/heads/kgiusti-python3 Commit: bcf01ac4096d56d74d4d190b74633830ce2ce75f Parents: b482e77 Author: Rafael Schloming <[email protected]> Authored: Thu Apr 30 09:01:12 2015 -0400 Committer: Rafael Schloming <[email protected]> Committed: Thu Apr 30 09:02:23 2015 -0400 ---------------------------------------------------------------------- CMakeLists.txt | 19 ++++++++++++++++--- proton-c/include/proton/version.h.in | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcf01ac4/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 966d333..d5667cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,13 +46,26 @@ if (BUILD_WITH_CXX) endif (BUILD_WITH_CXX) file(READ version.txt PN_VERSION_FILE) -string(REGEX MATCHALL "[0-9]+" PN_VERSION_LIST "${PN_VERSION_FILE}") +string(STRIP ${PN_VERSION_FILE} PN_VERSION_LINE) +string(REPLACE "-" ";" PN_VERSION_SPLIT "${PN_VERSION_LINE}") +list(GET PN_VERSION_SPLIT 0 PN_VERSION_CLEAN) +list(REMOVE_AT PN_VERSION_SPLIT 0) +string(REPLACE ";" "-" PN_VERSION_QUALIFIER "${PN_VERSION_SPLIT}") +string(REGEX MATCHALL "[0-9]+" PN_VERSION_LIST "${PN_VERSION_CLEAN}") list(GET PN_VERSION_LIST 0 PN_VERSION_MAJOR) list(GET PN_VERSION_LIST 1 PN_VERSION_MINOR) -set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}") -message(STATUS "PN_VERSION: ${PN_VERSION}") +list(LENGTH PN_VERSION_LIST PN_VERSION_LENGTH) +if (${PN_VERSION_LENGTH} GREATER 2) + list(GET PN_VERSION_LIST 2 PN_VERSION_POINT) + set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}.${PN_VERSION_POINT}") +else() + set (PN_VERSION_POINT 0) + set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}") +endif() + +message(STATUS "PN_VERSION: ${PN_VERSION} (${PN_VERSION_QUALIFIER})") enable_testing() include (CTest) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/bcf01ac4/proton-c/include/proton/version.h.in ---------------------------------------------------------------------- diff --git a/proton-c/include/proton/version.h.in b/proton-c/include/proton/version.h.in index 667281e..133b0bb 100644 --- a/proton-c/include/proton/version.h.in +++ b/proton-c/include/proton/version.h.in @@ -24,5 +24,6 @@ #define PN_VERSION_MAJOR @PN_VERSION_MAJOR@ #define PN_VERSION_MINOR @PN_VERSION_MINOR@ +#define PN_VERSION_POINT @PN_VERSION_POINT@ #endif /* version.h */ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
