Skip to content

Commit

Permalink
Make flatpak work again
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kebekus committed Nov 27, 2023
1 parent 0bac41c commit df66c42
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,42 @@ set(PROJECT_DATE 2023-11-24)
math(EXPR PROJECT_VERSION_CODE 100000*${PROJECT_VERSION_MAJOR}+1000*${PROJECT_VERSION_MINOR}+${PROJECT_VERSION_PATCH})
add_definitions( -DPROJECT_VERSION="${PROJECT_VERSION}" )

# Find GIT repository data.
if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git branch ${GIT_BRANCH}")

# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git Commit ${GIT_COMMIT}")

# Get the latest commit date of the working branch
execute_process(
COMMAND git log -1 --format=%as
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message("Currently working with git commit from ${GIT_DATE}")
else()
message("Not working from a GIT directory")
set(GIT_BRANCH "")
set(GIT_COMMIT "")
set(GIT_DATE "")
endif()
add_compile_definitions(GIT_COMMIT="${GIT_COMMIT}")


if(IOS)
set(PRODUCT_BUNDLE_IDENTIFIER de.akafliegfreiburg.addhoursandminutes)
Expand Down

0 comments on commit df66c42

Please sign in to comment.