Skip to content

Commit

Permalink
Merge pull request #310 from probonopd/issue-308
Browse files Browse the repository at this point in the history
Issue 308
  • Loading branch information
TheAssassin committed Jul 19, 2018
2 parents b9b3321 + b156524 commit f166933
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 40 deletions.
88 changes: 48 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,59 @@ project(linuxdeployqt)

find_program(GIT git)

# 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)

if("${GIT}" STREQUAL "GIT-NOTFOUND")
message(FATAL_ERROR "Could not find git")
endif()
message(WARNING "Could not find git, commit and tag info cannot be updated")

# 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
RESULT_VARIABLE GIT_COMMIT_RESULT
)
if(NOT GIT_COMMIT_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git commit ID")
endif()
mark_as_advanced(GIT_COMMIT GIT_COMMIT_RESULT)
if(NOT GIT_COMMIT)
message(FATAL_ERROR "Commit ID not set, please call with -DGIT_COMMIT=...")
endif()

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
RESULT_VARIABLE GIT_TAG_ID_RESULT
)
if(NOT GIT_TAG_ID_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag ID")
endif()
mark_as_advanced(GIT_TAG_ID GIT_TAG_ID_RESULT)
if(NOT GIT_TAG_NAME)
message(FATAL_ERROR "Tag name not set, please call with -DGIT_TAG_NAME=...")
endif()
else()
# 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)

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
RESULT_VARIABLE GIT_TAG_NAME_RESULT
)
if(NOT GIT_TAG_NAME_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag name")
# 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
RESULT_VARIABLE GIT_COMMIT_RESULT
)
if(NOT GIT_COMMIT_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git commit ID")
endif()
mark_as_advanced(GIT_COMMIT GIT_COMMIT_RESULT)

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
RESULT_VARIABLE GIT_TAG_ID_RESULT
)
if(NOT GIT_TAG_ID_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag ID")
endif()
mark_as_advanced(GIT_TAG_ID GIT_TAG_ID_RESULT)

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
RESULT_VARIABLE GIT_TAG_NAME_RESULT
)
if(NOT GIT_TAG_NAME_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git tag name")
endif()
mark_as_advanced(GIT_TAG_NAME GIT_TAG_NAME_RESULT)
endif()
mark_as_advanced(GIT_TAG_NAME GIT_TAG_NAME_RESULT)

# set version and build number
set(VERSION 1-alpha)
Expand Down
2 changes: 2 additions & 0 deletions tools/linuxdeployqt/excludelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static const QStringList generatedExcludelist = {
"libgcc_s.so.1",
"libgdk_pixbuf-2.0.so.0",
"libgio-2.0.so.0",
"libglapi.so.0",
"libglib-2.0.so.0",
"libGL.so.1",
"libgobject-2.0.so.0",
Expand Down Expand Up @@ -59,6 +60,7 @@ static const QStringList generatedExcludelist = {
"librt.so.1",
"libSM.so.6",
"libstdc++.so.6",
"libthai.so.0",
"libthread_db.so.1",
"libusb-1.0.so.0",
"libutil.so.1",
Expand Down

0 comments on commit f166933

Please sign in to comment.