From d078d4f5d17088b9f366c62f5b3eca7b167e665c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 27 Mar 2011 05:03:39 -0700 Subject: uhd: work on versioning technique for the releases --- host/Modules/UHDVersion.cmake | 25 +++++++++++++++++-------- host/lib/CMakeLists.txt | 3 ++- 2 files changed, 19 insertions(+), 9 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}") diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index a30b380c4..cb75979e8 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -112,7 +112,8 @@ LIBUHD_APPEND_SOURCES( ADD_LIBRARY(uhd SHARED ${libuhd_sources}) TARGET_LINK_LIBRARIES(uhd ${Boost_LIBRARIES} ${libuhd_libs}) SET_TARGET_PROPERTIES(uhd PROPERTIES DEFINE_SYMBOL "UHD_DLL_EXPORTS") -SET_TARGET_PROPERTIES(uhd PROPERTIES SOVERSION ${UHD_VERSION_MAJOR}) +SET_TARGET_PROPERTIES(uhd PROPERTIES SOVERSION "${UHD_VERSION_MAJOR}") +SET_TARGET_PROPERTIES(uhd PROPERTIES VERSION "${UHD_VERSION_MAJOR}.${UHD_VERSION_MINOR}") IF(DEFINED LIBUHD_OUTPUT_NAME) SET_TARGET_PROPERTIES(uhd PROPERTIES OUTPUT_NAME ${LIBUHD_OUTPUT_NAME}) ENDIF(DEFINED LIBUHD_OUTPUT_NAME) -- cgit v1.2.3