aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_version_info.cmd
blob: d82468711154e794c39d11df4c18692ba62ae2c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@echo off
rem https://stackoverflow.com/questions/3472631/how-do-i-get-the-day-month-and-year-from-a-windows-cmd-exe-script
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO (
    if "%%B" NEQ "" (
        SET /A FDATE=%%F*10000+%%D*100+%%A
    )
)
set year=%FDATE:~0,4%
set /p version=<VERSION

echo // version.h generated by GEMMA
rem https://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line
echo|set /p="#define GEMMA_VERSION ""
echo %version%"
echo #define GEMMA_DATE "%FDATE:~0,8%"
echo #define GEMMA_YEAR "%year%"