Clementine-audio-player-Mac.../cmake/Version.cmake

62 lines
2.3 KiB
CMake
Raw Normal View History

# Change this file when releasing a new version.
2010-09-19 22:44:31 +02:00
# Version numbers.
set(CLEMENTINE_VERSION_MAJOR 0)
2011-03-29 23:12:53 +02:00
set(CLEMENTINE_VERSION_MINOR 7)
set(CLEMENTINE_VERSION_PATCH 1)
2011-01-03 15:21:10 +01:00
#set(CLEMENTINE_VERSION_PRERELEASE rc1)
# This should be set to OFF in a tag
set(INCLUDE_GIT_REVISION ON)
2011-01-03 15:21:10 +01:00
# The format for version numbers is:
2011-03-29 23:12:53 +02:00
# Display: $major.$minor[.$patch] [$prerelease] [r$svn]
# Deb: $major.$minor[.$patch][~$prerelease][.r$svn]
# Rpm: $major.$minor[.$patch][$prerelease][.r$svn]
2011-01-03 15:21:10 +01:00
# And the rpm version is used for mac and windows
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_MAJOR}.${CLEMENTINE_VERSION_MINOR}")
2011-03-29 23:12:53 +02:00
# Add patch
if(CLEMENTINE_VERSION_PATCH)
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY}.${CLEMENTINE_VERSION_PATCH}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}.${CLEMENTINE_VERSION_PATCH}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_RPM}.${CLEMENTINE_VERSION_PATCH}")
endif(CLEMENTINE_VERSION_PATCH)
2011-01-03 15:21:10 +01:00
# Add prerelease
if(CLEMENTINE_VERSION_PRERELEASE)
set(CLEMENTINE_VERSION_DISPLAY "${CLEMENTINE_VERSION_DISPLAY} ${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_DEB "${CLEMENTINE_VERSION_DEB}~${CLEMENTINE_VERSION_PRERELEASE}")
set(CLEMENTINE_VERSION_RPM "${CLEMENTINE_VERSION_RPM}${CLEMENTINE_VERSION_PRERELEASE}")
endif(CLEMENTINE_VERSION_PRERELEASE)
# Add git revision
if(FORCE_GIT_REVISION)
set(GIT_REVISION ${FORCE_GIT_REVISION})
else(FORCE_GIT_REVISION)
find_program(GIT_EXECUTABLE git)
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_GIT_REVISION AND GIT_REVISION)
set(CLEMENTINE_VERSION_DISPLAY "${GIT_REVISION}")
set(CLEMENTINE_VERSION_DEB "${GIT_REVISION}")
# RPM doesn't like dashes in version numbers
string(REPLACE "-" "." CLEMENTINE_VERSION_RPM "${GIT_REVISION}")
endif(INCLUDE_GIT_REVISION AND GIT_REVISION)