2015-12-04 17:01:33 +02:00
|
|
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
:: ::
|
|
|
|
|
:: This file is part of IfcOpenShell. ::
|
|
|
|
|
:: ::
|
|
|
|
|
:: IfcOpenShell is free software: you can redistribute it and/or modify ::
|
|
|
|
|
:: it under the terms of the Lesser GNU General Public License as published by ::
|
|
|
|
|
:: the Free Software Foundation, either version 3.0 of the License, or ::
|
|
|
|
|
:: (at your option) any later version. ::
|
|
|
|
|
:: ::
|
|
|
|
|
:: IfcOpenShell is distributed in the hope that it will be useful, ::
|
|
|
|
|
:: but WITHOUT ANY WARRANTY; without even the implied warranty of ::
|
|
|
|
|
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ::
|
|
|
|
|
:: Lesser GNU General Public License for more details. ::
|
|
|
|
|
:: ::
|
|
|
|
|
:: You should have received a copy of the Lesser GNU General Public License ::
|
|
|
|
|
:: along with this program. If not, see <http://www.gnu.org/licenses/>. ::
|
|
|
|
|
:: ::
|
|
|
|
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
:: This batch file expects CMake generator as %1 and build configuration type as %2. If not provided,
|
|
|
|
|
:: a deduced generator will be used for %1 and BUILD_CFG_DEFAULT for %2 (both set in vs-cfg.cmd)
|
|
|
|
|
:: Possible extra parameters are passed for the MSBuild call.
|
|
|
|
|
|
2025-11-21 11:49:35 +05:00
|
|
|
@if not defined ECHO_ON ( echo off )
|
2015-12-04 17:01:33 +02:00
|
|
|
set PROJECT_NAME=IfcOpenShell
|
2015-12-07 16:30:08 +02:00
|
|
|
echo.
|
2015-12-04 17:01:33 +02:00
|
|
|
|
|
|
|
|
:: Enable the delayed environment variable expansion needed in VSConfig.cmd.
|
|
|
|
|
setlocal EnableDelayedExpansion
|
2016-06-17 23:30:33 +03:00
|
|
|
set IFCOS_PAUSE_ON_ERROR=
|
|
|
|
|
|
|
|
|
|
:: Read cached variables from the most recently modified BuildDepsCache.txt.
|
|
|
|
|
for /f "tokens=*" %%f in ('dir BuildDepsCache-*.txt /o:-n /t:a /b') do (
|
|
|
|
|
for /f "delims== tokens=1,2" %%G in (%%f) do set %%G=%%H
|
|
|
|
|
)
|
|
|
|
|
set GENERATOR=%1
|
|
|
|
|
if (%1)==() (
|
|
|
|
|
if not defined GEN_SHORTHAND (
|
|
|
|
|
echo BuildDepsCache file does and/or GEN_SHORTHAND missing from it. Run build-deps.cmd to create it.
|
|
|
|
|
set IFCOS_PAUSE_ON_ERROR=pause
|
|
|
|
|
goto :Error
|
|
|
|
|
)
|
|
|
|
|
set GENERATOR=%GEN_SHORTHAND%
|
|
|
|
|
echo Generator not passed, but GEN_SHORTHAND=!GENERATOR! read from BuildDepsCache
|
|
|
|
|
echo.
|
|
|
|
|
)
|
|
|
|
|
call vs-cfg.cmd %GENERATOR%
|
2016-01-31 18:45:33 +02:00
|
|
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|
|
|
|
call build-type-cfg.cmd %2
|
2015-12-04 17:01:33 +02:00
|
|
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|
|
|
|
|
|
|
|
|
echo.
|
2015-12-07 16:30:08 +02:00
|
|
|
IF "%IFCOS_NUM_BUILD_PROCS%"=="" set IFCOS_NUM_BUILD_PROCS=%NUMBER_OF_PROCESSORS%
|
|
|
|
|
call cecho.cmd 0 13 "* IFCOS_NUM_BUILD_PROCS`t= %IFCOS_NUM_BUILD_PROCS%"
|
|
|
|
|
echo.
|
|
|
|
|
|
2015-12-04 17:01:33 +02:00
|
|
|
call cecho.cmd 0 13 "Installing %VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME%"
|
2016-06-17 23:30:33 +03:00
|
|
|
cmake --build ..\%BUILD_DIR% --target INSTALL -- /nologo /m:%IFCOS_NUM_BUILD_PROCS% /p:Platform=%VS_PLATFORM% ^
|
2015-12-07 16:30:08 +02:00
|
|
|
/p:Configuration=%BUILD_CFG% %3 %4 %5 %6 %7 %8 %9
|
2015-12-04 17:01:33 +02:00
|
|
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|
|
|
|
|
|
|
|
|
echo.
|
|
|
|
|
call cecho.cmd 0 10 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation finished."
|
2016-01-31 20:26:40 +02:00
|
|
|
set IFCOS_SCRIPT_RET=0
|
2015-12-04 17:01:33 +02:00
|
|
|
goto :End
|
|
|
|
|
|
|
|
|
|
:Error
|
|
|
|
|
echo.
|
2016-12-30 15:57:13 +02:00
|
|
|
call "%~dp0\utils\cecho.cmd" 0 12 "%VS_PLATFORM% %BUILD_CFG% %PROJECT_NAME% installation failed!"
|
2016-06-17 23:30:33 +03:00
|
|
|
%IFCOS_PAUSE_ON_ERROR%
|
2016-01-31 20:26:40 +02:00
|
|
|
set IFCOS_SCRIPT_RET=1
|
2015-12-04 17:01:33 +02:00
|
|
|
|
|
|
|
|
:End
|
2016-01-31 20:26:40 +02:00
|
|
|
exit /b %IFCOS_SCRIPT_RET%
|