@@ -5,41 +5,77 @@ setlocal
55set toolset = v145
66set args =
77set args2 =
8- for %%t in (%* ) do call :set_arg %%t
9- goto :build
8+ for %%t in (%* ) do call :set_arg " %%t "
9+ if errorlevel 1 goto :eof
10+ if exist build rd /s/q build
11+ if exist build goto :eof
12+ md build & cd build
13+ set cmd = cmake .. -G " Visual Studio 18 2026" -A x64 -T %toolset% %args% %args2%
14+ echo %cmd%
15+ %cmd%
16+ cd ..
17+ goto :eof
1018
1119:set_arg
12- if %1 == v140 (
13- set toolset = %1
20+ if %1 == " v140" (
21+ set toolset = v140
1422 set args = -DCMAKE_SYSTEM_VERSION=" 10.0.19041.0"
23+ goto :eof
1524)
16- if %1 == v140_xp (
17- set toolset = %1
25+ if %1 == " v140_xp" (
26+ set toolset = v140_xp
1827 set args = -DCMAKE_SYSTEM_VERSION=" 10.0.19041.0"
28+ goto :eof
1929)
20- if %1 == v141 (
21- set toolset = %1
30+ if %1 == " v141" (
31+ set toolset = v141
2232 set args = -DCMAKE_SYSTEM_VERSION=" 10.0.19041.0"
33+ goto :eof
2334)
24- if %1 == v142 (
25- set toolset = %1
35+ if %1 == " v142" (
36+ set toolset = v142
37+ goto :eof
2638)
27- if %1 == v143 (
28- set toolset = %1
39+ if %1 == " v143" (
40+ set toolset = v143
41+ goto :eof
2942)
30- if %1 == v145 (
31- set toolset = %1
43+ if %1 == " v145" (
44+ set toolset = v145
45+ goto :eof
3246)
33- if /i %1 == DLL (
34- set args2 = -DBUILD_SHARED_LIBS:BOOL=ON -DLINK_STATIC_RUNTIME:BOOL=OFF
47+ if /i %1 == " DLL" (
48+ set args2 = %args2% -DBUILD_SHARED_LIBS:BOOL=ON
49+ set args2 = %args2% -DLINK_STATIC_RUNTIME:BOOL=OFF
50+ goto :eof
3551)
36- goto :eof
52+ if /i %1 == " COVERAGE" (
53+ set args2 = %args2% -DBUILD_COVERAGE:BOOL=ON
54+ goto :eof
55+ )
56+ for %%s in (help -h --help) do (
57+ if /i %1 == " %%s " (
58+ goto :help
59+ )
60+ )
61+ echo Unknown option: %~1
62+ echo Use 'help' for options.
63+ exit /b 1
3764
38- :build
39- if exist build rd /s/q build
40- if exist build goto :eof
41- md build & cd build
42- set cmd = cmake .. -G " Visual Studio 18 2026" -A x64 -T %toolset% %args% %args2%
43- echo %cmd%
44- %cmd%
45- cd ..
65+ :help
66+ echo Usage: configure [ARGS...]
67+ echo .
68+ echo Toolset (If multiple, last one wins).
69+ echo v140 Visual Studio 2015
70+ echo v140_xp Visual Studio 2015 (Windows XP compatible).
71+ echo v141 Visual Studio 2017
72+ echo v142 Visual Studio 2019
73+ echo v143 Visual Studio 2022
74+ echo v145 Visual Studio 2026
75+ echo .
76+ echo Miscellaneous
77+ echo dll Build Shared Libs (Otherwise everything static linked).
78+ echo coverage Includes assert tests and, if gcc, code coverage report.
79+ echo .
80+ echo help Show this message and exit.
81+ exit /b 1
0 commit comments