-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.cmd
54 lines (39 loc) · 1.25 KB
/
builder.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
@echo off
rem https://stackoverflow.com/questions/3785976/cmake-generate-visual-studio-2008-solution-for-win32-and-x64
rem ===== Usage
rem builder [-32bit|-64bit] [-Debug|-Release]
rem --> Defaults: -64bit -Release
rem Global configuration variables. Should be update based on your system
SET VISUAL_STUDIO_NAME=Visual Studio 14 2015
SET CMAKE_HOME=C:\Program Files\CMake
rem First parameter is project folder path
SET PROJECT_DIR="%~dp0"
SET ORIGINAL_DIR="%cd%"
SET CMAKE="%CMAKE_HOME%\bin\cmake.exe"
rem Go to project directory
cd %PROJECT_DIR%
rem Second parameter defines 32 bit or 64 bit compilation
if "%1"=="-32bit" (
echo === Generating 32bit project ===
rmdir /s /q build_32
md build_32
cd build_32
%CMAKE% .. -G "%VISUAL_STUDIO_NAME%" -A Win32
) ELSE (
echo === Generating 64bit project ===
rmdir /s /q build_64
md build_64
cd build_64
%CMAKE% .. -G "%VISUAL_STUDIO_NAME%" -A x64
)
rem Third parameter defines debug or release compilation
if "%2"=="-Debug" (
echo === Building in Debug mode ===
%CMAKE% --build . --target PACKAGE --config Debug
) ELSE (
echo === Building in Release mode ===
%CMAKE% --build . --target PACKAGE --config Release
)
rem Go to source code directory and finalize script
cd %ORIGINAL_DIR%
@echo on