Skip to content

Commit 7c4832c

Browse files
committed
[cmake\scripts\*.bat] Write build and packaging scripts for: Cygwin; MinGW (32-bit and 64-bit); MSVC 2005 (32-bit and 64-bit); MSVC 2022 (32-bit and 64-bit); OpenWatcom's DOS target (16-bit) ; [README.md] Reflect the existence of these scripts
1 parent 9862245 commit 7c4832c

File tree

10 files changed

+92
-17
lines changed

10 files changed

+92
-17
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ cmake --build .
4949
ctest -C Debug
5050
```
5151

52+
### Script to automatically build
53+
54+
Build, test, and package for:
55+
56+
- Cygwin;
57+
- MinGW (32-bit and 64-bit);
58+
- MSVC 2005 (32-bit and 64-bit);
59+
- MSVC 2022 (32-bit and 64-bit);
60+
- OpenWatcom's DOS target (16-bit).
61+
62+
…by running in Command Prompt: `cmake\scripts\build_all.bat`
63+
5264
#### Instructions for MSVC 2005
5365

5466
With cmake-3.11.4 specified, do:

cmake/scripts/build_all.bat

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
@echo on
2+
3+
call "%~dp0\build_cygwin.bat"
4+
call "%~dp0\build_mingw32.bat"
5+
call "%~dp0\build_mingw64.bat"
26
call "%~dp0\build_msvc64_2005.bat"
3-
call "%~dp0\build_msvc86_2005.bat"
47
call "%~dp0\build_msvc64_2022.bat"
8+
call "%~dp0\build_msvc86_2005.bat"
59
call "%~dp0\build_msvc86_2022.bat"
6-
:: build_dos
7-
:: build_mingw32
8-
:: build_mingw64
9-
:: build_cygwin
10+
call "%~dp0\build_openwatcom_dos.bat"

cmake/scripts/build_cygwin.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo on
2+
3+
IF NOT DEFINED CYGWININSTALLDIR (
4+
set CYGWININSTALLDIR="C:\usr\cygwin64"
5+
)
6+
7+
set build_dir="build_cygwin"
8+
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
9+
md "%build_dir%"
10+
cd "%build_dir%"
11+
12+
set pth=%CD:~2,99%
13+
set pth=%pth:\=/%
14+
set drv=%CD:~0,1%
15+
set "fullpath=/cygdrive/%drv%%pth%"
16+
17+
%CYGWININSTALLDIR%"\bin\bash" --login -c "cd '%fullpath%' && cmake -DCMAKE_BUILD_TYPE='Debug' -DCMAKE_MAKE_PROGRAM=$(cygpath $(where ninja)) -G 'Ninja' .. && cmake --build . && ctest -C 'Debug' && cpack -G 'ZIP' -C 'Debug'"
18+
cd ..

cmake/scripts/build_mingw64.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo on
2+
3+
IF NOT DEFINED MINGW64INSTALLDIR (
4+
set MINGW64INSTALLDIR="C:\usr\msys64"
5+
)
6+
7+
set build_dir="build_mingw64"
8+
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
9+
md "%build_dir%"
10+
cd "%build_dir%"
11+
12+
set pth=%CD:~2,99%
13+
set pth=%pth:\=/%
14+
set drv=%CD:~0,1%
15+
set "fullpath=/%drv%%pth%"
16+
17+
call %MINGW64INSTALLDIR%"\msys2_shell.cmd" -mingw64 -c "cd '%fullpath%' && cmake -DCMAKE_BUILD_TYPE='Debug' .. && cmake --build . && ctest -C 'Debug' && cpack -G 'ZIP' -C 'Debug'"
18+
cd ..

cmake/scripts/build_mingw86.bat

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo on
2+
3+
IF NOT DEFINED MINGW64INSTALLDIR (
4+
set MINGW64INSTALLDIR="C:\usr\msys64"
5+
)
6+
7+
set build_dir="build_mingw86"
8+
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
9+
md "%build_dir%"
10+
cd "%build_dir%"
11+
12+
set pth=%CD:~2,99%
13+
set pth=%pth:\=/%
14+
set drv=%CD:~0,1%
15+
set "fullpath=/%drv%%pth%"
16+
17+
call %MINGW64INSTALLDIR%"\msys2_shell.cmd" -mingw32 -c "cd '%fullpath%' && cmake -DCMAKE_BUILD_TYPE='Debug' .. && cmake --build . && ctest -C 'Debug' && cpack -G 'ZIP' -C 'Debug'"
18+
cd ..

cmake/scripts/build_msvc64_2005.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
IF NOT DEFINED VSINSTALLDIR (
44
set VSINSTALLDIR="C:\PROGRA~2\Microsoft Visual Studio 8"
55
)
6-
call "%VSINSTALLDIR%\VC\vcvarsall.bat"
6+
call "C:\PROGRA~2\Microsoft Visual Studio 8\VC\vcvarsall.bat" x64
77

88
set build_dir="build_msvc64_2005"
99
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
1010
md "%build_dir%"
1111
cd "%build_dir%"
12-
cmake -DCMAKE_BUILD_TYPE="Debug" -G "NMake Makefiles" .. && cmake --build . && ctest -C Debug
12+
cmake -DCMAKE_BUILD_TYPE="Debug" -G "NMake Makefiles" .. && cmake --build . && ctest -C "Debug" && cpack -G "ZIP" -C "Debug" && ren *.zip *-msvc2005-win64.zip
1313
cd ..

cmake/scripts/build_msvc64_2022.bat

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
IF NOT DEFINED VS2022INSTALLDIR (
44
set VS2022INSTALLDIR="C:\PROGRA~1\Microsoft Visual Studio\2022\Enterprise"
55
)
6-
7-
IF EXIST "%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" (
8-
call "%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
9-
) ELSE (
10-
call "\VC\Auxiliary\Build\vcvars64.bat"
11-
)
6+
call "%VS2022INSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
127

138
set build_dir="build_msvc64_2022"
149
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
1510
md "%build_dir%"
1611
cd "%build_dir%"
17-
cmake -DCMAKE_BUILD_TYPE="Debug" -G "Visual Studio 17 2022" -A x64 .. && cmake --build . && ctest -C Debug
12+
cmake -DCMAKE_BUILD_TYPE="Debug" -G "Visual Studio 17 2022" -A x64 .. && cmake --build . && ctest -C "Debug" && cpack -G "ZIP" -C "Debug" && ren *.zip *-msvc2022-win64.zip
1813
cd ..

cmake/scripts/build_msvc86_2005.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
IF NOT DEFINED VSINSTALLDIR (
44
set VSINSTALLDIR="C:\PROGRA~2\Microsoft Visual Studio 8"
55
)
6-
call "%VSINSTALLDIR%\VC\vcvarsall.bat"
6+
call "C:\PROGRA~2\Microsoft Visual Studio 8\VC\vcvarsall.bat"
77

88
set build_dir="build_msvc86_2005"
99
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
1010
md "%build_dir%"
1111
cd "%build_dir%"
12-
cmake -DCMAKE_BUILD_TYPE="Debug" -G "NMake Makefiles" .. && cmake --build . && ctest -C Debug
12+
cmake -DCMAKE_BUILD_TYPE="Debug" -G "NMake Makefiles" .. && cmake --build . && ctest -C "Debug" && cpack -G "ZIP" -C "Debug" && ren *.zip *-msvc2005-win32.zip
1313
cd ..

cmake/scripts/build_msvc86_2022.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ set build_dir="build_msvc86_2022"
99
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
1010
md "%build_dir%"
1111
cd "%build_dir%"
12-
cmake -DCMAKE_BUILD_TYPE="Debug" -G "Visual Studio 17 2022" -A x86 .. && cmake --build . && ctest -C Debug
12+
cmake -DCMAKE_BUILD_TYPE="Debug" -G "Visual Studio 17 2022" -A "Win32" .. && cmake --build . && ctest -C "Debug" && cpack -G "ZIP" -C "Debug" && ren *.zip *-msvc2022-win32.zip
1313
cd ..
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@echo on
2+
3+
IF NOT DEFINED WATCOMINSTALLDIR (
4+
set WATCOMINSTALLDIR="C:\usr\WATCOM"
5+
)
6+
call "%WATCOMINSTALLDIR%\owsetenv.bat"
7+
8+
set build_dir="build_dos"
9+
IF EXIST "%build_dir%" rd /s /q "%build_dir%"
10+
md "%build_dir%"
11+
cd "%build_dir%"
12+
cmake -DCMAKE_BUILD_TYPE="Debug" -G "Watcom WMake" -DCMAKE_SYSTEM_NAME="DOS" -DCMAKE_SYSTEM_PROCESSOR="I86" .. && cmake --build . && cpack -G "ZIP" -C "Debug" -DCPACK_ARCHIVE_FILE_EXTENSION=".zip"
13+
cd ..

0 commit comments

Comments
 (0)