mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-28 18:19:42 +01:00
Update cmake version script to use git describe instead of svn info.
This commit is contained in:
parent
f5b8bbec9e
commit
a2e4f8e6b3
@ -6,8 +6,8 @@ set(CLEMENTINE_VERSION_MINOR 7)
|
||||
set(CLEMENTINE_VERSION_PATCH 1)
|
||||
#set(CLEMENTINE_VERSION_PRERELEASE rc1)
|
||||
|
||||
# This should be set to OFF in an svn tag
|
||||
set(INCLUDE_SVN_REVISION ON)
|
||||
# This should be set to OFF in a tag
|
||||
set(INCLUDE_GIT_REVISION ON)
|
||||
|
||||
# The format for version numbers is:
|
||||
# Display: $major.$minor[.$patch] [$prerelease] [r$svn]
|
||||
@ -35,26 +35,25 @@ if(CLEMENTINE_VERSION_PRERELEASE)
|
||||
endif(CLEMENTINE_VERSION_PRERELEASE)
|
||||
|
||||
# Add svn revision
|
||||
if(FORCE_SVN_REVISION)
|
||||
set(SVN_REVISION ${FORCE_SVN_REVISION})
|
||||
else(FORCE_SVN_REVISION)
|
||||
include(FindSubversion)
|
||||
find_package(Subversion)
|
||||
if(FORCE_GIT_REVISION)
|
||||
set(GIT_REVISION ${FORCE_GIT_REVISION})
|
||||
else(FORCE_GIT_REVISION)
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
|
||||
if(Subversion_FOUND)
|
||||
execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info ${PROJECT_SOURCE_DIR}
|
||||
RESULT_VARIABLE SVN_INFO_RESULT
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET)
|
||||
if(${SVN_INFO_RESULT} EQUAL 0)
|
||||
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} clementine)
|
||||
set(SVN_REVISION ${clementine_WC_REVISION})
|
||||
endif(${SVN_INFO_RESULT} EQUAL 0)
|
||||
endif(Subversion_FOUND)
|
||||
endif(FORCE_SVN_REVISION)
|
||||
if(NOT GIT_EXECUTABLE-NOTFOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe
|
||||
RESULT_VARIABLE GIT_INFO_RESULT
|
||||
OUTPUT_VARIABLE GIT_REV
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(${GIT_INFO_RESULT} EQUAL 0)
|
||||
set(GIT_REVISION ${GIT_REV})
|
||||
endif(${GIT_INFO_RESULT} EQUAL 0)
|
||||
endif(NOT GIT_EXECUTABLE-NOTFOUND)
|
||||
endif(FORCE_GIT_REVISION)
|
||||
|
||||
if(INCLUDE_SVN_REVISION AND SVN_REVISION)
|
||||
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY} r${SVN_REVISION}")
|
||||
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}.r${SVN_REVISION}")
|
||||
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_RPM}.r${SVN_REVISION}")
|
||||
endif(INCLUDE_SVN_REVISION AND SVN_REVISION)
|
||||
if(INCLUDE_GIT_REVISION AND GIT_REVISION)
|
||||
set(CLEMENTINE_VERSION_DISPLAY "${GIT_REVISION}")
|
||||
set(CLEMENTINE_VERSION_DEB "${GIT_REVISION}")
|
||||
set(CLEMENTINE_VERSION_RPM "${GIT_REVISION}")
|
||||
endif(INCLUDE_GIT_REVISION AND GIT_REVISION)
|
||||
|
Loading…
x
Reference in New Issue
Block a user