Browse Source

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
tags/v1.1.90
Pierre Ossman 13 years ago
parent
commit
e8115169a9
1 changed files with 12 additions and 6 deletions
  1. 12
    6
      CMakeLists.txt

+ 12
- 6
CMakeLists.txt View File

@@ -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)

Loading…
Cancel
Save