summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-06-05 13:37:36 +0200
committerMattes D <github@xoft.cz>2015-06-05 13:37:36 +0200
commit5ee0657c6981a950e164ee2737d6057df6531a15 (patch)
tree563557557c4a70704a68153798465959ba1272dc /CMakeLists.txt
parentAdded Build info to the cRoot API. (diff)
downloadcuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar.gz
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar.bz2
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar.lz
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar.xz
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.tar.zst
cuberite-5ee0657c6981a950e164ee2737d6057df6531a15.zip
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a459b243..01158a7e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,11 +51,18 @@ else()
RESULT_VARIABLE GIT_EXECUTED
OUTPUT_VARIABLE BUILD_COMMIT_ID
)
+ if (NOT(GIT_EXECUTED EQUAL 0))
+ set(BUILD_COMMIT_ID "Unknown")
+ endif()
string(STRIP ${BUILD_COMMIT_ID} BUILD_COMMIT_ID)
execute_process(
COMMAND git log -1 --date=iso --pretty=format:%ai
+ RESULT_VARIABLE GIT_EXECUTED
OUTPUT_VARIABLE BUILD_DATETIME
)
+ if (NOT(GIT_EXECUTED EQUAL 0))
+ set(BUILD_DATETIME "Unknown")
+ endif()
string(STRIP ${BUILD_DATETIME} BUILD_DATETIME)
# The BUILD_COMMIT_ID and BUILD_DATETIME aren't updated on each repo pull