9 FOR %%b in (%1, %2) DO (
12 ) ELSE ( IF %%b == clean (
19 rem set Visual C++ build environment
20 call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat"
22 SET WORKDIR=%WORKSPACE%
24 IF "%WORKDIR%" == "" (
25 SET WORKDIR=%CD%\..\..\..
28 rem setup some paths that we need later
31 SET BASE_PATH=%WORKDIR%\project\cmake\
32 SET ADDONS_PATH=%BASE_PATH%\addons
33 SET ADDONS_OUTPUT_PATH=%ADDONS_PATH%\output
34 SET ADDON_DEPENDS_PATH=%ADDONS_PATH%\depends\win32
35 SET ADDON_DEPENDS_BUILD_PATH=%ADDON_DEPENDS_PATH%\build
37 SET ERRORFILE=%BASE_PATH%\make-addon-depends.error
39 IF %noclean% == false (
40 rem remove the output directory if it exists
41 IF EXIST "%ADDONS_OUTPUT_PATH%" (
42 RMDIR "%ADDONS_OUTPUT_PATH%" /S /Q > NUL
45 rem remove the build directory if it exists
46 IF EXIST "%ADDON_DEPENDS_BUILD_PATH%" (
47 RMDIR "%ADDON_DEPENDS_BUILD_PATH%" /S /Q > NUL
51 rem create the output directory
52 IF NOT EXIST "%ADDONS_OUTPUT_PATH%" MKDIR "%ADDONS_OUTPUT_PATH%"
54 rem create the build directory
55 IF NOT EXIST "%ADDON_DEPENDS_BUILD_PATH%" MKDIR "%ADDON_DEPENDS_BUILD_PATH%"
57 rem go into the build directory
58 CD "%ADDON_DEPENDS_BUILD_PATH%"
60 rem execute cmake to generate makefiles processable by nmake
61 cmake "%ADDON_DEPENDS_PATH%" -G "NMake Makefiles" ^
62 -DCMAKE_BUILD_TYPE=Release ^
63 -DCMAKE_INSTALL_PREFIX=%ADDONS_OUTPUT_PATH%
65 ECHO cmake error level: %ERRORLEVEL% > %ERRORFILE%
69 rem execute nmake to build the addon depends
72 ECHO nmake error level: %ERRORLEVEL% > %ERRORFILE%
76 rem everything was fine
80 rem something went wrong
81 ECHO Failed to build addon dependencies
82 ECHO See %ERRORFILE% for more details
86 rem go back to the original directory
89 rem exit the script with the defined exitcode