Skip to content

Commit

Permalink
Fixing generated GenerateBuildVersion.vcxproj when one builds on diff…
Browse files Browse the repository at this point in the history
…erent

locale than english. The problem is that date and time CLI utilities
generates different format so that REGEX in CMake does not work.
  • Loading branch information
koldat committed Jan 27, 2016
1 parent d20915d commit d7f22b6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ cmake_minimum_required(VERSION 2.6)
project(rocksdb)

include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc)

execute_process(COMMAND $ENV{COMSPEC} " /C date /T" OUTPUT_VARIABLE DATE)
execute_process(COMMAND $ENV{COMSPEC} " /C time /T" OUTPUT_VARIABLE TIME)
string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" DATE ${DATE})
execute_process(COMMAND powershell -Command "Get-Date -format MM_dd_yyyy" OUTPUT_VARIABLE DATE)
execute_process(COMMAND powershell -Command "Get-Date -format HH:mm:ss" OUTPUT_VARIABLE TIME)
string(REGEX REPLACE "(..)_(..)_..(..).*" "\\1/\\2/\\3" DATE ${DATE})
string(REGEX REPLACE "(..):(.....).*" " \\1:\\2" TIME ${TIME})
string(CONCAT GIT_DATE_TIME ${DATE} ${TIME})

Expand Down

0 comments on commit d7f22b6

Please sign in to comment.