aboutsummaryrefslogtreecommitdiffstats
path: root/host/cmake
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-03-10 16:00:16 -0800
committerMartin Braun <martin.braun@ettus.com>2016-03-11 09:46:24 -0800
commit165fd400e995c9652c2dfe85c2fd589b750a2620 (patch)
tree2ecc8921d7c20142ca1733cccd9a48460f4336b0 /host/cmake
parent736b8a2b707472c3ad527a7fb6e79971bac99497 (diff)
downloaduhd-165fd400e995c9652c2dfe85c2fd589b750a2620.tar.gz
uhd-165fd400e995c9652c2dfe85c2fd589b750a2620.tar.bz2
uhd-165fd400e995c9652c2dfe85c2fd589b750a2620.zip
cmake: Rename version strings for dev branches
Diffstat (limited to 'host/cmake')
-rw-r--r--host/cmake/Modules/UHDVersion.cmake36
1 files changed, 35 insertions, 1 deletions
diff --git a/host/cmake/Modules/UHDVersion.cmake b/host/cmake/Modules/UHDVersion.cmake
index 696817a96..54af40676 100644
--- a/host/cmake/Modules/UHDVersion.cmake
+++ b/host/cmake/Modules/UHDVersion.cmake
@@ -32,9 +32,43 @@ SET(UHD_VERSION_PATCH git)
SET(UHD_VERSION_DEVEL TRUE)
########################################################################
-# Set up trimmed version numbers for DLL resource files and packages
+# If we're on a development branch, we skip the patch version
########################################################################
+IF(NOT DEFINED UHD_VERSION_DEVEL)
+ SET(UHD_VERSION_DEVEL FALSE)
+ENDIF(NOT DEFINED UHD_VERSION_DEVEL)
+SET(UHD_GIT_BRANCH "")
+IF(GIT_FOUND)
+ EXECUTE_PROCESS(
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+ OUTPUT_VARIABLE _git_branch OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE _git_branch_result
+ )
+ IF(_git_branch_result EQUAL 0)
+ IF(_git_branch STREQUAL "maint")
+ MESSAGE(STATUS "Operating on maint branch (stable).")
+ ELSEIF(_git_branch STREQUAL "master")
+ MESSAGE(STATUS "Operating on master branch.")
+ SET(UHD_VERSION_DEVEL TRUE)
+ ELSE()
+ MESSAGE(STATUS "Working off of feature or development branch. Updating version number.")
+ EXECUTE_PROCESS(
+ COMMAND ${PYTHON_EXECUTABLE} -c "print('${_git_branch}'.replace('/', '-'))"
+ OUTPUT_VARIABLE _git_safe_branch OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ SET(UHD_VERSION_PATCH ${_git_safe_branch})
+ SET(UHD_VERSION_DEVEL TRUE)
+ SET(UHD_GIT_BRANCH ${_git_branch})
+ ENDIF()
+ ELSE()
+ MESSAGE(STATUS "Could not determine git branch. Probably building from tarball.")
+ ENDIF()
+ENDIF(GIT_FOUND)
+########################################################################
+# Set up trimmed version numbers for DLL resource files and packages
+########################################################################
FUNCTION(DEPAD_NUM input_num output_num)
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}