forked from LuxCoreRender/LuxCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.bat
128 lines (107 loc) · 2.53 KB
/
make.bat
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@echo off
REM Convenience wrapper for CMake commands
REM Script command (1st parameter)
set COMMAND=%1
echo Build cmake args: %BUILD_CMAKE_ARGS%
if "%BUILD_DIR%" == "" (
set BUILD_DIR=.\build
)
if "%INSTALL_DIR%" == "" (
set INSTALL_DIR=.\build
)
set SOURCE_DIR=%cd%
if "%LUX_PYTHON%" == "" (
set LUX_PYTHON=python.exe
)
if "%COMMAND%" == "" (
call :Luxcore
call :PyLuxcore
call :LuxcoreUI
call :LuxcoreConsole
call :InvokeCMakeInstall
) else if "%COMMAND%" == "luxcore" (
call :Luxcore
call :InvokeCMakeInstall luxcore
) else if "%COMMAND%" == "pyluxcore" (
call :PyLuxcore
call :InvokeCMakeInstall pyluxcore
) else if "%COMMAND%" == "luxcoreui" (
call :LuxcoreUI
call :InvokeCMakeInstall luxcoreui
call :InvokeCMakeInstall luxcore
) else if "%COMMAND%" == "luxcoreconsole" (
call :LuxcoreConsole
call :InvokeCMakeInstall luxcoreconsole
call :InvokeCMakeInstall luxcore
) else if "%COMMAND%" == "config" (
call :Config
) else if "%COMMAND%" == "install" (
call :InvokeCMakeInstall
) else if "%COMMAND%" == "clean" (
call :Clean
) else if "%COMMAND%" == "clear" (
call :Clear
) else if "%COMMAND%" == "deps" (
call :Deps
) else if "%COMMAND%" == "list-presets" (
call :ListPresets
) else (
echo Command "%COMMAND%" unknown
)
exit /B
:InvokeCMakeConfig
setlocal
for /f "delims=" %%A in ('python cmake\get_preset.py') do set "PRESET=%%A"
set PRESET=conan-release
echo CMake preset: %PRESET%
cmake %BUILD_CMAKE_ARGS% --preset %PRESET% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -S %SOURCE_DIR% -G Ninja
endlocal
goto :EOF
:InvokeCMakeBuild
setlocal
for /f "delims=" %%A in ('python cmake\get_preset.py') do set "PRESET=%%A"
set PRESET=conan-release
echo CMake preset: %PRESET%
set TARGET=%1
cmake --build --preset %PRESET% --target %TARGET% %BUILD_CMAKE_ARGS%
endlocal
goto :EOF
:InvokeCMakeInstall
IF "%~1" == "" (
cmake --install %BUILD_DIR%/cmake --prefix %BUILD_DIR%
) else (
cmake --install %BUILD_DIR%/cmake --prefix %BUILD_DIR% --component %1
)
goto :EOF
:Clean
call :InvokeCMake clean
goto :EOF
:Config
call :InvokeCMakeConfig %CONAN_PRESET%
goto :EOF
:Luxcore
call :Config
call :InvokeCMakeBuild luxcore
goto :EOF
:PyLuxcore
call :Config
call :InvokeCMakeBuild pyluxcore
goto :EOF
:LuxcoreUI
call :Config
call :InvokeCMakeBuild luxcoreui
goto :EOF
:LuxcoreConsole
call :Config
call :InvokeCMakeBuild luxcoreconsole
goto :EOF
:Clear
rmdir /S /Q %BUILD_DIR%
goto :EOF
:Deps
%LUX_PYTHON% -u cmake\make_deps.py
goto :EOF
:ListPresets
cmake --list-presets
goto :EOF
:EOF