mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Display Commit ID Used for Build in AboutDialog (#6516)
* Display commit ID used for build in AboutDialog * Dynamically check for snapshots --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
02438e25bc
commit
091ab68811
3 changed files with 36 additions and 0 deletions
|
@ -22,6 +22,28 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
# Check if Orca is on a tag
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --exact-match --tags
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_TAG_CHECK
|
||||
)
|
||||
if(NOT GIT_TAG_CHECK EQUAL 0)
|
||||
add_definitions("-DSNAPSHOT_BUILD=1")
|
||||
endif()
|
||||
|
||||
# Check current Git commit hash
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{SLIC3R_STATIC})
|
||||
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
|
||||
else()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue