aboutsummaryrefslogtreecommitdiffstats
path: root/host/Modules/UHDVersion.cmake
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-03-27 05:03:39 -0700
committerJosh Blum <josh@joshknows.com>2011-03-27 05:03:39 -0700
commitd078d4f5d17088b9f366c62f5b3eca7b167e665c (patch)
tree41eee568855967602bd63b7e0d6d26e3cf51d751 /host/Modules/UHDVersion.cmake
parentf5390d04229572b3d342f910e731e2b9dccf8505 (diff)
downloaduhd-d078d4f5d17088b9f366c62f5b3eca7b167e665c.tar.gz
uhd-d078d4f5d17088b9f366c62f5b3eca7b167e665c.tar.bz2
uhd-d078d4f5d17088b9f366c62f5b3eca7b167e665c.zip
uhd: work on versioning technique for the releases
Diffstat (limited to 'host/Modules/UHDVersion.cmake')
-rw-r--r--host/Modules/UHDVersion.cmake25
1 files changed, 17 insertions, 8 deletions
diff --git a/host/Modules/UHDVersion.cmake b/host/Modules/UHDVersion.cmake
index 9b20bb98a..440ce6698 100644
--- a/host/Modules/UHDVersion.cmake
+++ b/host/Modules/UHDVersion.cmake
@@ -17,19 +17,28 @@
########################################################################
INCLUDE(UHDPython) #requires python for parsing
+FIND_PACKAGE(Git QUIET)
########################################################################
# Setup Version Numbers
+# - increment major on api compatibility changes
+# - increment minor on feature-level changes
+# - increment patch on for bug fixes and docs
########################################################################
-SET(UHD_VERSION_MAJOR 003) #API compatibility number
-SET(UHD_VERSION_MINOR 0) #Timestamp of git commit
-SET(UHD_VERSION_PATCH 0) #Short hash of git commit
+SET(UHD_VERSION_MAJOR 003)
+SET(UHD_VERSION_MINOR 000)
+SET(UHD_VERSION_PATCH 000)
########################################################################
-# Find GIT to get repo information
+# Version information discovery through git log
########################################################################
-FIND_PACKAGE(Git QUIET)
-IF(GIT_FOUND)
+IF(UHD_PACKAGE_MODE STREQUAL AUTO)
+ SET(UHD_VERSION_DISCOVERY FALSE)
+ELSE()
+ SET(UHD_VERSION_DISCOVERY GIT_FOUND)
+ENDIF()
+
+IF(UHD_VERSION_DISCOVERY)
#grab the git log entry for the current head
EXECUTE_PROCESS(
@@ -50,7 +59,7 @@ IF(GIT_FOUND)
COMMAND ${PYTHON_EXECUTABLE} -c "import time; print time.strftime('%Y%m%d%H%M%S', time.gmtime(${_git_timestamp}))"
OUTPUT_VARIABLE _git_date OUTPUT_STRIP_TRAILING_WHITESPACE
)
- SET(UHD_VERSION_MINOR ${_git_date})
+ #SET(UHD_VERSION_MINOR ${_git_date})
#grab the git ref id for the current head
EXECUTE_PROCESS(
@@ -59,7 +68,7 @@ IF(GIT_FOUND)
OUTPUT_VARIABLE _git_rev OUTPUT_STRIP_TRAILING_WHITESPACE
)
SET(UHD_VERSION_PATCH ${_git_rev})
-ENDIF(GIT_FOUND)
+ENDIF(UHD_VERSION_DISCOVERY)
########################################################################
SET(UHD_VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_MINOR}.${UHD_VERSION_PATCH}")