summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-03-03 12:51:38 +0000
committerPierre Ossman <ossman@cendio.se>2011-03-03 12:51:38 +0000
commite8115169a9092498d38a3c09db0659df5fac023b (patch)
treeace2342f493272da8173ddf89755b045f37b6c43
parent0bfc1cd41672532ec0c4ff9ad8ae51d2c2dd29cf (diff)
downloadtigervnc-e8115169a9092498d38a3c09db0659df5fac023b.tar.gz
tigervnc-e8115169a9092498d38a3c09db0659df5fac023b.zip
Make the build id generation work on other targets than Windows.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4318 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--CMakeLists.txt18
1 files changed, 12 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c692b91..bbe9a27a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,15 +10,21 @@ set(VERSION 1.0.90)
# The RC version must always be four comma-separated numbers
set(RCVERSION 1,0,90,0)
-if(MINGW OR CYGWIN)
- execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
- string(REGEX REPLACE "\n" "" BUILD ${BUILD})
-elseif(WIN32)
+# Try to encode today's date into the build id. We assume that MSVC
+# means we need to use a native Windows method, otherwise we assume
+# some kind of Unix system. The id will be empty if things fail.
+set(BUILD "")
+if(MSVC)
execute_process(COMMAND "${CMAKE_SOURCE_DIR}/cmakescripts/getdate.bat"
OUTPUT_VARIABLE BUILD)
- string(REGEX REPLACE "\n" "" BUILD ${BUILD})
else()
- message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.")
+ execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
+endif()
+
+if(NOT BUILD)
+ set(BUILD "")
+else()
+ string(REGEX REPLACE "\n" "" BUILD ${BUILD})
endif()
if(NOT CMAKE_BUILD_TYPE)