|
@ -5,4 +5,52 @@ cmake_minimum_required(VERSION 3.2) |
|
|
|
|
|
|
|
|
project(linuxdeployqt) |
|
|
project(linuxdeployqt) |
|
|
|
|
|
|
|
|
|
|
|
# read Git revision ID |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND git rev-parse --short HEAD |
|
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT |
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
# make sure Git revision ID and latest tag is not stored in the CMake cache |
|
|
|
|
|
# otherwise, one would have to reset the CMake cache on every new commit to make sure the Git commit ID is up to date |
|
|
|
|
|
unset(GIT_COMMIT CACHE) |
|
|
|
|
|
unset(GIT_LATEST_TAG CACHE) |
|
|
|
|
|
|
|
|
|
|
|
# read Git revision ID and latest tag number |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND git rev-parse --short HEAD |
|
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT |
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
|
|
) |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND git rev-list --tags --skip=1 --max-count=1 |
|
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
|
|
|
OUTPUT_VARIABLE GIT_TAG_ID |
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
|
|
) |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND git describe --tags ${GIT_TAG_ID} --abbrev=0 |
|
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} |
|
|
|
|
|
OUTPUT_VARIABLE GIT_TAG_NAME |
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
# set version and build number |
|
|
|
|
|
set(VERSION 1-alpha) |
|
|
|
|
|
if("$ENV{TRAVIS_BUILD_NUMBER}" STREQUAL "") |
|
|
|
|
|
set(BUILD_NUMBER "<local dev build>") |
|
|
|
|
|
else() |
|
|
|
|
|
set(BUILD_NUMBER "$ENV{TRAVIS_BUILD_NUMBER}") |
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# get current date |
|
|
|
|
|
execute_process( |
|
|
|
|
|
COMMAND env LC_ALL=C date -u "+%Y-%m-%d %H:%M:%S %Z" |
|
|
|
|
|
OUTPUT_VARIABLE DATE |
|
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
add_subdirectory(tools/linuxdeployqt) |
|
|
add_subdirectory(tools/linuxdeployqt) |
|
|