-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.cmd
62 lines (51 loc) · 1.63 KB
/
Makefile.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
rem This file makes your life easier.
rem Running this file will automatically pick appropriate cmake project generator
rem and they will be forwarded to cmake.
setlocal enabledelayedexpansion
set "CMAKE_ARGS=%*"
IF NOT EXIST cmake-build (
mkdir cmake-build
)
if EXIST cmake-build\environment.cmd (
call cmake-build\environment.cmd
goto process
)
:prepare
if "!PROCESSOR_ARCHITECTURE!" == "AMD64" (
set /P "PLATFORM=Platform (x86/[x64]): " || set "PLATFORM=x64"
) else (
set "PLATFORM=x86"
)
echo set "PLATFORM=!PLATFORM!" > cmake-build\environment.cmd
set /P "VS=Visual Studio (2019/[2022]): " || set "VS=2022"
echo set "VS=!VS!" >> cmake-build\environment.cmd
:process
set "VS_PLATFORM=!PLATFORM!"
if "!VS_PLATFORM!" == "x86" (
set "VS_PLATFORM=Win32"
)
set "CMAKE_GENRATOR=Visual Studio"
if "!VS!" == "2019" (
set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 16"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" !PLATFORM!
) else if "!VS!" == "2022" (
set "CMAKE_GENRATOR=!CMAKE_GENRATOR! 17"
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" !PLATFORM!
) else (
echo Unknown Visual Studio version
goto quit
)
set "CMAKE_GENRATOR=!CMAKE_GENRATOR! !vs!"
set "CMAKE_GENRATOR=!CMAKE_GENRATOR!"
set CMAKE_ARGS=-A !VS_PLATFORM! !CMAKE_ARGS!
echo Using !CMAKE_GENRATOR! on !PLATFORM!
:build
pushd cmake-build
echo cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
cmake.exe -G "!CMAKE_GENRATOR!" !CMAKE_ARGS! ..
echo "Platform: !VS_PLATFORM!"
msbuild rbfx.sln /p:Platform="!VS_PLATFORM!" /t:restore
popd
:quit
@pause