Skip to content
Snippets Groups Projects
Commit 91123c5d authored by Ben Boeckel's avatar Ben Boeckel
Browse files

sciberquest: be smarter about getting the date

Change-Id: I7a19fd7cf0dc22144a94c8a1c813f2ffe748d3f9
parent 97826b1d
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,14 @@
# Copyright 2012 SciberQuest Inc.
#
macro (GetDate RESULT)
set(${RESULT} "00/00/0000")
if (WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
elseif (UNIX)
execute_process(COMMAND "date" "+%m/%d/%Y" OUTPUT_VARIABLE ${RESULT})
if (CMAKE_VERSION VERSION_LESS 2.8.11)
set(${RESULT} "00/00/0000")
if (WIN32)
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
elseif (UNIX)
execute_process(COMMAND "date" "+%m/%d/%Y" OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
else ()
string(TIMESTAMP ${RESULT} "%m/%d/%Y")
endif ()
string(REGEX REPLACE "(.*)(\n|\r)$" "\\1" ${RESULT} ${${RESULT}})
endmacro ()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment