Skip to content

Commit

Permalink
CMakeLists.txt: Fix version number
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviermartin committed Aug 5, 2019
1 parent 6a770e4 commit 42c9f26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ endif()
# Packaging
#
set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr CACHE STRING "Install directory (default: /usr).")
if (ENV{TRAVIS_TAG} AND (NOT "ENV{TRAVIS_TAG}" STREQUAL "dev"))
if (DEFINED ENV{TRAVIS_TAG} AND (NOT "ENV{TRAVIS_TAG}" STREQUAL "dev"))
message("Package Gattlib for tagged version $ENV{TRAVIS_TAG}")
set(CPACK_PACKAGE_VERSION $ENV{TRAVIS_TAG})

# Transform 'v0.3' into '0.3' and 'v0.3-rc1' into '0.3-rc1'
string(REGEX REPLACE "v([0-9]+).([0-9]+)(.*)" "\\1.\\2\\3" CPACK_PACKAGE_VERSION $ENV{TRAVIS_TAG})
else()
set(CPACK_PACKAGE_VERSION 0.2-dev)
set(CPACK_PACKAGE_VERSION 0.3-dev)
message("Package Gattlib for development version $ENV{CPACK_PACKAGE_VERSION}")
endif()
set(CPACK_PACKAGE_CONTACT "Olivier Martin <olivier@labapart.com>")
Expand Down

0 comments on commit 42c9f26

Please sign in to comment.