build: add OVERRIDE_VERSION, used in Travis
Fixes https://github.com/awesomeWM/awesome/issues/160.
This commit is contained in:
parent
3cd0bb5783
commit
fdc3f2cc17
|
@ -90,6 +90,9 @@ install:
|
||||||
# Deps for functional tests.
|
# Deps for functional tests.
|
||||||
- sudo apt-get install -qq dbus-x11 xterm xdotool xterm xvfb
|
- sudo apt-get install -qq dbus-x11 xterm xdotool xterm xvfb
|
||||||
|
|
||||||
|
# Determine custom version.
|
||||||
|
- '[ "$TRAVIS_PULL_REQUEST" = false ] && version="${TRAVIS_BRANCH}-g$(git rev-parse --short HEAD)-$(date -Iseconds)" || version="${TRAVIS_BRANCH}-PR${TRAVIS_PULL_REQUEST}-g$(git rev-parse --short HEAD)-$(date -Iseconds)"'
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIB} -DLUA_INCLUDE_DIR=/usr/include/lua${LUAPKG}"
|
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIB} -DLUA_INCLUDE_DIR=/usr/include/lua${LUAPKG} -D OVERRIDE_VERSION=$version"
|
||||||
- make && sudo env PATH=$PATH make install && awesome --version && tests/run.sh
|
- make && sudo env PATH=$PATH make install && awesome --version && tests/run.sh
|
||||||
|
|
|
@ -89,14 +89,16 @@ endif()
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# {{{ Version stamp
|
# {{{ Version stamp
|
||||||
if(EXISTS ${SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
if(OVERRIDE_VERSION)
|
||||||
|
set(VERSION ${OVERRIDE_VERSION})
|
||||||
|
elseif(EXISTS ${SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
||||||
# get current version
|
# get current version
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_EXECUTABLE} describe --dirty
|
COMMAND ${GIT_EXECUTABLE} describe --dirty
|
||||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE VERSION
|
OUTPUT_VARIABLE VERSION
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
# file the git-version-stamp.sh script will look into
|
# File the build-utils/git-version-stamp.sh script will look into.
|
||||||
set(VERSION_STAMP_FILE ${BUILD_DIR}/.version_stamp)
|
set(VERSION_STAMP_FILE ${BUILD_DIR}/.version_stamp)
|
||||||
file(WRITE ${VERSION_STAMP_FILE} ${VERSION})
|
file(WRITE ${VERSION_STAMP_FILE} ${VERSION})
|
||||||
# create a version_stamp target later
|
# create a version_stamp target later
|
||||||
|
|
Loading…
Reference in New Issue