mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 16:50:53 +01:00
Fix CMake build when git revision can't be determined
This commit is contained in:
committed by
Laurent Trinques
parent
491efe7b1d
commit
86f8b85a78
@@ -28,9 +28,6 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
|||||||
# This strips terminating newline in the variable
|
# This strips terminating newline in the variable
|
||||||
string(REGEX REPLACE "\n$" "" GIT_COMMIT_SHA "${GIT_COMMIT_SHA}")
|
string(REGEX REPLACE "\n$" "" GIT_COMMIT_SHA "${GIT_COMMIT_SHA}")
|
||||||
|
|
||||||
# This adds to definitions => .cpp
|
|
||||||
add_definitions(-DGIT_COMMIT_SHA="${GIT_COMMIT_SHA}")
|
|
||||||
|
|
||||||
if(NOT GIT_COMMIT_RESULT EQUAL "0")
|
if(NOT GIT_COMMIT_RESULT EQUAL "0")
|
||||||
message(
|
message(
|
||||||
FATAL_ERROR
|
FATAL_ERROR
|
||||||
@@ -39,3 +36,6 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
|||||||
", please check")
|
", please check")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# This adds to definitions => .cpp
|
||||||
|
add_definitions(-DGIT_COMMIT_SHA="${GIT_COMMIT_SHA}")
|
||||||
|
|||||||
Reference in New Issue
Block a user