[VERSION]

Replace binary tool in repository by a Windows one to get current date. (supported since Windows XP/2003)

svn path=/trunk/; revision=59294
This commit is contained in:
Sylvain Petreolle 2013-06-22 22:33:49 +00:00
parent 54332ae012
commit 1d319c931b
4 changed files with 4 additions and 16 deletions

View file

@ -1,7 +1,9 @@
macro(today RESULT)
if(CMAKE_HOST_WIN32)
execute_process(COMMAND "${REACTOS_SOURCE_DIR}/tools/getdate.exe" OUTPUT_VARIABLE ${RESULT})
string(STRIP ${${RESULT}} ${RESULT})
execute_process(COMMAND wmic os get LocalDateTime OUTPUT_VARIABLE RAWDATE)
string(REPLACE "\n" ";" RAWDATE ${RAWDATE})
LIST(GET RAWDATE 1 RAWDATE)
string(SUBSTRING ${RAWDATE} 0 8 ${RESULT})
elseif(CMAKE_HOST_UNIX)
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
string(STRIP ${${RESULT}} ${RESULT})

View file

@ -1,13 +0,0 @@
#include <stdio.h>
#include <time.h>
void main()
{
char curdate[9];
time_t now;
struct tm *tm_now;
time(&now);
tm_now=localtime(&now);
strftime(curdate, sizeof(curdate), "%Y%m%d", tm_now);
printf("%s", curdate);
}

View file

@ -1 +0,0 @@
gcc getdate.c -o getdate.exe -s

Binary file not shown.