summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-09-22 13:13:15 +0200
committerPierre Ossman <ossman@cendio.se>2014-09-22 13:14:11 +0200
commit5945d73be74f5dd087165156e5f588da7f43cf57 (patch)
tree0d26502d07980a75d56bd0916594a20fbbda0cbe /CMakeLists.txt
parent34e12985048e83ea15ed3f626367b437102abcd8 (diff)
downloadtigervnc-5945d73be74f5dd087165156e5f588da7f43cf57.tar.gz
tigervnc-5945d73be74f5dd087165156e5f588da7f43cf57.zip
Fix the build timestamp to be more translation friendly
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 7 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f4ccd48..24e923e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,13 +39,13 @@ if(MSVC)
message(FATAL_ERROR "TigerVNC cannot be built with Visual Studio. Please use MinGW")
endif()
-set(BUILD "")
-execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
+set(BUILD_TIMESTAMP "")
+execute_process(COMMAND "date" "+%Y-%m-%d %H:%M" OUTPUT_VARIABLE BUILD_TIMESTAMP)
-if(NOT BUILD)
- set(BUILD "")
+if(NOT BUILD_TIMESTAMP)
+ set(BUILD_TIMESTAMP "")
else()
- string(REGEX REPLACE "\n" "" BUILD ${BUILD})
+ string(REGEX REPLACE "\n" "" BUILD_TIMESTAMP ${BUILD_TIMESTAMP})
endif()
# Default to optimised builds instead of debug ones. Our code has no bugs ;)
@@ -56,12 +56,8 @@ endif()
message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- set(BUILD "${BUILD}d")
-endif()
-
-message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}")
-add_definitions(-D__BUILD__="${BUILD}")
+message(STATUS "VERSION = ${VERSION}")
+add_definitions(-DBUILD_TIMESTAMP="${BUILD_TIMESTAMP}")
# We want to keep our asserts even in release builds so remove NDEBUG
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -UNDEBUG")