2015-10-28 19:43:10 +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/>. ::
|
|
|
|
|
:: ::
|
|
|
|
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
@echo off
|
|
|
|
|
echo.
|
|
|
|
|
|
|
|
|
|
set PROJECT_NAME=IfcOpenShell
|
|
|
|
|
|
|
|
|
|
setlocal EnableDelayedExpansion
|
2016-01-26 09:21:38 +02:00
|
|
|
|
2015-10-28 19:43:10 +02:00
|
|
|
call vs-cfg.cmd %1
|
2015-12-01 14:47:49 +02:00
|
|
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
2016-02-03 22:16:50 +02:00
|
|
|
:: As CMake options are typically of format -DSOMETHING:BOOL=ON or -DSOMETHING=1, i.e. they contain an equal sign,
|
|
|
|
|
:: they will mess up the batch file argument parsing if the arguments are passed on by splitting them %2 %3 %4 %5
|
|
|
|
|
:: %6 %7 %8 %9. Work around that, http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute
|
2016-02-06 18:48:18 +02:00
|
|
|
if not (%1)==() (
|
|
|
|
|
set ARGUMENTS=%*
|
|
|
|
|
call set ARGUMENTS=%%ARGUMENTS:%1=%%
|
|
|
|
|
)
|
2015-10-28 19:43:10 +02:00
|
|
|
|
2015-11-09 16:04:06 +02:00
|
|
|
:: Read Python related variables from BuildDepsCache.txt
|
|
|
|
|
for /f "delims== tokens=1,2" %%G in (BuildDepsCache-%TARGET_ARCH%.txt) do set %%G=%%H
|
|
|
|
|
|
2015-11-03 16:06:20 +02:00
|
|
|
pushd ..
|
|
|
|
|
set CMAKE_INSTALL_PREFIX=%CD%\installed-vs%VS_VER%-%TARGET_ARCH%
|
|
|
|
|
popd
|
2015-10-28 19:43:10 +02:00
|
|
|
|
|
|
|
|
IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
|
|
|
|
|
pushd ..\%BUILD_DIR%
|
|
|
|
|
|
|
|
|
|
set BOOST_ROOT=%DEPS_DIR%\boost
|
|
|
|
|
set BOOST_LIBRARYDIR=%DEPS_DIR%\boost\stage\vs%VS_VER%-%VS_PLATFORM%\lib
|
|
|
|
|
set ICU_INCLUDE_DIR=%INSTALL_DIR%\icu\include
|
|
|
|
|
set ICU_LIBRARY_DIR=%INSTALL_DIR%\icu\lib
|
|
|
|
|
set OCC_INCLUDE_DIR=%INSTALL_DIR%\oce\include\oce
|
|
|
|
|
set OCC_LIBRARY_DIR=%INSTALL_DIR%\oce\Win%ARCH_BITS%\lib
|
|
|
|
|
set OPENCOLLADA_INCLUDE_DIR=%INSTALL_DIR%\OpenCOLLADA\include\opencollada
|
|
|
|
|
set OPENCOLLADA_LIBRARY_DIR=%INSTALL_DIR%\OpenCOLLADA\lib\opencollada
|
2016-01-26 09:21:38 +02:00
|
|
|
if not defined PY_VER_MAJOR_MINOR set PY_VER_MAJOR_MINOR=34
|
2016-02-18 14:57:57 +01:00
|
|
|
if not defined PYTHONHOME set PYTHONHOME=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
|
|
|
|
|
set PYTHON_INCLUDE_DIR=%PYTHONHOME%\include
|
|
|
|
|
set PYTHON_LIBRARY=%PYTHONHOME%\libs\python%PY_VER_MAJOR_MINOR%.lib
|
|
|
|
|
set PYTHON_EXECUTABLE=%PYTHONHOME%\python.exe
|
2015-10-28 19:43:10 +02:00
|
|
|
set SWIG_DIR=%INSTALL_DIR%\swigwin
|
2016-02-18 14:57:57 +01:00
|
|
|
set PATH=%PATH%;%SWIG_DIR%;%PYTHONHOME%
|
2015-10-30 22:46:04 +02:00
|
|
|
:: TODO 3ds Max SDK?
|
2015-10-28 19:43:10 +02:00
|
|
|
|
|
|
|
|
echo.
|
2015-11-19 17:30:29 +02:00
|
|
|
call cecho.cmd 0 10 "Script configuration:"
|
2016-02-03 16:15:40 +02:00
|
|
|
echo Generator = %GENERATOR%
|
2016-02-03 22:16:50 +02:00
|
|
|
echo Arguments = %ARGUMENTS%
|
2015-10-28 19:43:10 +02:00
|
|
|
echo.
|
2015-11-19 17:30:29 +02:00
|
|
|
call cecho.cmd 0 10 "Dependency Environment Variables for %PROJECT_NAME%:"
|
2015-10-28 19:43:10 +02:00
|
|
|
echo BOOST_ROOT = %BOOST_ROOT%
|
|
|
|
|
echo BOOST_LIBRARYDIR = %BOOST_LIBRARYDIR%
|
|
|
|
|
echo ICU_INCLUDE_DIR = %ICU_INCLUDE_DIR%
|
|
|
|
|
echo ICU_LIBRARY_DIR = %ICU_LIBRARY_DIR%
|
|
|
|
|
echo OCC_INCLUDE_DIR = %OCC_INCLUDE_DIR%
|
|
|
|
|
echo OCC_LIBRARY_DIR = %OCC_LIBRARY_DIR%
|
|
|
|
|
echo OPENCOLLADA_INCLUDE_DIR = %OPENCOLLADA_INCLUDE_DIR%
|
|
|
|
|
echo OPENCOLLADA_LIBRARY_DIR = %OPENCOLLADA_LIBRARY_DIR%
|
2016-02-18 14:57:57 +01:00
|
|
|
echo PYTHONHOME = %PYTHONHOME%
|
2015-11-03 16:06:20 +02:00
|
|
|
echo PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR%
|
|
|
|
|
echo PYTHON_LIBRARY = %PYTHON_LIBRARY%
|
2016-02-15 16:59:47 +01:00
|
|
|
echo PYTHON_EXECUTABLE = %PYTHON_EXECUTABLE%
|
2015-10-28 19:43:10 +02:00
|
|
|
echo SWIG_DIR = %SWIG_DIR%
|
|
|
|
|
echo.
|
|
|
|
|
echo CMAKE_INSTALL_PREFIX = %CMAKE_INSTALL_PREFIX%
|
|
|
|
|
echo.
|
|
|
|
|
|
|
|
|
|
set CMAKELISTS_DIR=..\cmake
|
2016-02-03 16:01:06 +02:00
|
|
|
:: For now clear CMakeCache.txt always in order to assure that when changing build options everything goes smoothly.
|
|
|
|
|
IF EXIST CMakeCache.txt. del /Q CMakeCache.txt
|
|
|
|
|
call cecho.cmd 0 13 "Running CMake for %PROJECT_NAME%."
|
2016-02-03 22:16:50 +02:00
|
|
|
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" %ARGUMENTS%
|
2016-02-03 16:01:06 +02:00
|
|
|
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
|
|
|
|
|
2015-10-28 19:43:10 +02:00
|
|
|
echo.
|
|
|
|
|
|
2016-01-31 20:26:40 +02:00
|
|
|
set IFCOS_SCRIPT_RET=0
|
2015-10-28 19:43:10 +02:00
|
|
|
goto :Finish
|
|
|
|
|
|
|
|
|
|
:Error
|
|
|
|
|
echo.
|
2015-12-01 14:47:49 +02:00
|
|
|
call %~dp0\utils\cecho.cmd 0 12 "An error occurred! Aborting!"
|
2016-01-31 20:26:40 +02:00
|
|
|
set IFCOS_SCRIPT_RET=1
|
2015-10-28 19:43:10 +02:00
|
|
|
goto :Finish
|
|
|
|
|
|
|
|
|
|
:Finish
|
|
|
|
|
popd
|
2016-01-31 20:26:40 +02:00
|
|
|
exit /b %IFCOS_SCRIPT_RET%
|