diff options
author | DannyArends | 2018-02-28 15:38:31 +0100 |
---|---|---|
committer | DannyArends | 2018-02-28 15:38:31 +0100 |
commit | 1b4bdcfabe6d618548114fecba93c8188fb4a7dc (patch) | |
tree | 3cd3aa9444e351b4261f8f380ff818cb6cba67fd /scripts/gen_version_info.cmd | |
parent | de72b4a9235c6932364fc1930fc243abfdd134e6 (diff) | |
download | pangemma-1b4bdcfabe6d618548114fecba93c8188fb4a7dc.tar.gz |
Windows script to generate src/version.h
Diffstat (limited to 'scripts/gen_version_info.cmd')
-rw-r--r-- | scripts/gen_version_info.cmd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/gen_version_info.cmd b/scripts/gen_version_info.cmd new file mode 100644 index 0000000..d824687 --- /dev/null +++ b/scripts/gen_version_info.cmd @@ -0,0 +1,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%" |