mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 05:46:51 +00:00
merge all
This commit is contained in:
+16
-16
@@ -58,9 +58,9 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
|
||||
:: Set up the BuildDepsCache.txt filename
|
||||
IF DEFINED VS_TOOLSET (
|
||||
set BUILDDEPTHCACHE=BuildDepsCache-%VS_PLATFORM%-%VS_TOOLSET%.txt
|
||||
set BUILD_DEPS_CACHE_PATH=BuildDepsCache-%VS_PLATFORM%-%VS_TOOLSET%.txt
|
||||
) ELSE (
|
||||
set BUILDDEPTHCACHE=BuildDepsCache-%VS_PLATFORM%.txt
|
||||
set BUILD_DEPS_CACHE_PATH=BuildDepsCache-%VS_PLATFORM%.txt
|
||||
)
|
||||
|
||||
:: fix for Visual C++ hanging when compiling 32-bit release OCCT up to version 7.4.0
|
||||
@@ -162,7 +162,7 @@ set /p do_continue="> "
|
||||
if "%do_continue%"=="n" goto :Finish
|
||||
|
||||
:: Cache last used CMake generator for other scripts to use
|
||||
if defined GEN_SHORTHAND echo GEN_SHORTHAND=%GEN_SHORTHAND%>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
if defined GEN_SHORTHAND echo GEN_SHORTHAND=%GEN_SHORTHAND%>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
|
||||
echo.
|
||||
set START_TIME=%TIME%
|
||||
@@ -209,7 +209,7 @@ cd "%DEPENDENCY_DIR%"
|
||||
call cecho.cmd 0 13 "Building %DEPENDENCY_NAME% %BOOST_LIBS% Please be patient, this will take a while."
|
||||
IF EXIST "%DEPENDENCY_DIR%\bin.v2\project-cache.jam" del "%DEPS_DIR%\boost\bin.v2\project-cache.jam"
|
||||
|
||||
call .\b2 toolset=%BOOST_TOOLSET% runtime-link=static address-model=%ARCH_BITS% -j%IFCOS_NUM_BUILD_PROCS% ^
|
||||
call .\b2 toolset=%BOOST_TOOLSET% runtime-link=static address-model=%ARCH_BITS% --abbreviate-paths -j%IFCOS_NUM_BUILD_PROCS% ^
|
||||
variant=%DEBUG_OR_RELEASE_LOWERCASE% %BOOST_WIN_API% %BOOST_LIBS% stage --stagedir=stage/%GEN_SHORTHAND%
|
||||
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
@@ -249,10 +249,10 @@ if %IFCOS_USE_OCCT%==FALSE goto :OCE
|
||||
set OCCT_VERSION=7.3.0p3
|
||||
SET OCCT_VER=V%OCCT_VERSION:.=_%
|
||||
|
||||
set OCC_INCLUDE_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\inc>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
set OCC_LIBRARY_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\win%ARCH_BITS%\lib>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo OCC_INCLUDE_DIR=%OCC_INCLUDE_DIR%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo OCC_LIBRARY_DIR=%OCC_LIBRARY_DIR%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
set OCC_INCLUDE_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\inc>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
set OCC_LIBRARY_DIR=%INSTALL_DIR%\opencascade-%OCCT_VERSION%\win%ARCH_BITS%\lib>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
echo OCC_INCLUDE_DIR=%OCC_INCLUDE_DIR%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
echo OCC_LIBRARY_DIR=%OCC_LIBRARY_DIR%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
|
||||
:: OCCT has many dependencies but FreeType is the only mandatory
|
||||
set DEPENDENCY_NAME=FreeType
|
||||
@@ -326,10 +326,10 @@ del "%INSTALL_DIR%\opencascade-%OCCT_VERSION%\*.bat"
|
||||
goto :Python
|
||||
|
||||
:OCE
|
||||
set OCC_INCLUDE_DIR=%INSTALL_DIR%\oce\include\oce>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
set OCC_LIBRARY_DIR=%INSTALL_DIR%\oce\Win%ARCH_BITS%\lib>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo OCC_INCLUDE_DIR=%OCC_INCLUDE_DIR%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo OCC_LIBRARY_DIR=%OCC_LIBRARY_DIR%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
set OCC_INCLUDE_DIR=%INSTALL_DIR%\oce\include\oce>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
set OCC_LIBRARY_DIR=%INSTALL_DIR%\oce\Win%ARCH_BITS%\lib>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
echo OCC_INCLUDE_DIR=%OCC_INCLUDE_DIR%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
echo OCC_LIBRARY_DIR=%OCC_LIBRARY_DIR%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
|
||||
set DEPENDENCY_NAME=Open CASCADE Community Edition
|
||||
set DEPENDENCY_DIR=%DEPS_DIR%\oce
|
||||
@@ -369,8 +369,8 @@ set PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.msi
|
||||
:: NOTE/TODO 3.5.0 doesn't use MSI any longer, but exe: set PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.exe
|
||||
IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||
REM Store Python versions to BuildDepsCache.txt for run-cmake.bat
|
||||
echo PY_VER_MAJOR_MINOR=%PY_VER_MAJOR_MINOR%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo PYTHONHOME=%PYTHONHOME%>>"%~dp0\%BUILDDEPTHCACHE%"
|
||||
echo PY_VER_MAJOR_MINOR=%PY_VER_MAJOR_MINOR%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
echo PYTHONHOME=%PYTHONHOME%>>"%~dp0\%BUILD_DEPS_CACHE_PATH%"
|
||||
|
||||
cd "%DEPS_DIR%"
|
||||
call :DownloadFile http://121.36.151.68:9008/download/python/3.4.3/python-3.4.3.amd64.msi "%DEPS_DIR%" %PYTHON_INSTALLER%
|
||||
@@ -526,8 +526,8 @@ pushd %BUILD_DIR%
|
||||
:: cache always e.g. when we've had new changes in the repository.
|
||||
IF %BUILD_TYPE%==Rebuild IF EXIST CMakeCache.txt. del CMakeCache.txt
|
||||
|
||||
IF DEFINED VS_TOOLSET (
|
||||
cmake .. -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET% %*
|
||||
IF NOT "%VS_TOOLSET_HOST%"=="" (
|
||||
cmake .. -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET_HOST% %*
|
||||
) ELSE (
|
||||
cmake .. -G %GENERATOR% -A %VS_PLATFORM% %*
|
||||
)
|
||||
|
||||
+31
-10
@@ -25,24 +25,45 @@ set PROJECT_NAME=IfcOpenShell
|
||||
setlocal EnableDelayedExpansion
|
||||
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 no GENERATOR was provided, read cached variables from any BuildDepsCache-XXX.txt
|
||||
:: found in this directory; note that if more than one is present, the result could be wrong!
|
||||
if (%1)==() (
|
||||
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
|
||||
)
|
||||
|
||||
if not defined GEN_SHORTHAND (
|
||||
echo BuildDepsCache file does not exist 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%
|
||||
set GENERATOR=!GEN_SHORTHAND!
|
||||
echo Generator not passed, but GEN_SHORTHAND=!GENERATOR! read from BuildDepsCache
|
||||
echo.
|
||||
)
|
||||
|
||||
call vs-cfg.cmd %GENERATOR%
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
|
||||
:: If cached variables are still undefined,
|
||||
:: read them from the specific BuildDepsCache-XXX.txt.
|
||||
set "_test=0"
|
||||
if not defined OCC_INCLUDE_DIR set _test=1
|
||||
if not defined OCC_LIBRARY_DIR set _test=1
|
||||
if %_test% EQU 1 (
|
||||
IF DEFINED VS_TOOLSET (
|
||||
set "BUILD_DEPS_CACHE_PATH=BuildDepsCache-%VS_PLATFORM%-%VS_TOOLSET%.txt"
|
||||
) ELSE (
|
||||
set "BUILD_DEPS_CACHE_PATH=BuildDepsCache-%VS_PLATFORM%.txt"
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%f in ('dir !BUILD_DEPS_CACHE_PATH! /o:-n /t:a /b') do (
|
||||
for /f "delims== tokens=1,2" %%G in (%%f) do set %%G=%%H
|
||||
)
|
||||
)
|
||||
|
||||
:: 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
|
||||
@@ -52,7 +73,7 @@ if not (%1)==() (
|
||||
)
|
||||
|
||||
pushd ..
|
||||
set CMAKE_INSTALL_PREFIX=%CD%\installed-%GEN_SHORTHAND%
|
||||
set CMAKE_INSTALL_PREFIX=%CD%\_installed-%GEN_SHORTHAND%
|
||||
popd
|
||||
|
||||
IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
|
||||
@@ -110,10 +131,10 @@ set CMAKELISTS_DIR=..\cmake
|
||||
if not (%1)==() if exist CMakeCache.txt. del /Q CMakeCache.txt
|
||||
call cecho.cmd 0 13 "Running CMake for %PROJECT_NAME%."
|
||||
|
||||
IF DEFINED VS_TOOLSET (
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" %ARGUMENTS%
|
||||
IF NOT "%VS_TOOLSET_HOST%"=="" (
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -T %VS_TOOLSET_HOST% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=On %ARGUMENTS%
|
||||
) ELSE (
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" %ARGUMENTS%
|
||||
cmake.exe %CMAKELISTS_DIR% -G %GENERATOR% -A %VS_PLATFORM% -DCMAKE_INSTALL_PREFIX="%CMAKE_INSTALL_PREFIX%" -DBoost_NO_BOOST_CMAKE=On %ARGUMENTS%
|
||||
)
|
||||
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
|
||||
+14
-5
@@ -54,10 +54,10 @@ if not "!GEN_SHORTHAND!"=="" if !GEN_SHORTHAND!==!GENERATOR! goto :GeneratorShor
|
||||
|
||||
set "VS_PLATFORM=Win32"
|
||||
:: use the command prompt target platform, at least initially
|
||||
if %VSCMD_ARG_TGT_ARCH%==x86 set "VS_PLATFORM=Win32"
|
||||
if %VSCMD_ARG_TGT_ARCH%==x64 set "VS_PLATFORM=x64"
|
||||
if %VSCMD_ARG_TGT_ARCH%==arm set "VS_PLATFORM=ARM"
|
||||
if %VSCMD_ARG_TGT_ARCH%==arm64 set "VS_PLATFORM=ARM64"
|
||||
if "%VSCMD_ARG_TGT_ARCH%"=="x86" set "VS_PLATFORM=Win32"
|
||||
if "%VSCMD_ARG_TGT_ARCH%"=="x64" set "VS_PLATFORM=x64"
|
||||
if "%VSCMD_ARG_TGT_ARCH%"=="arm" set "VS_PLATFORM=ARM"
|
||||
if "%VSCMD_ARG_TGT_ARCH%"=="arm64" set "VS_PLATFORM=ARM64"
|
||||
|
||||
:: "echo if" trick from http://stackoverflow.com/a/8758579
|
||||
echo(!GEN_SHORTHAND! | findstr /c:"-x86" >nul && ( set "VS_PLATFORM=Win32" )
|
||||
@@ -160,15 +160,24 @@ IF %VS_VER%==2019 ( set "VC_VER=14.2" )
|
||||
set BOOST_BOOTSTRAP_VER=vc%VC_VER%
|
||||
set BOOST_BOOTSTRAP_VER=%BOOST_BOOTSTRAP_VER:.=%
|
||||
|
||||
set VS_TOOLSET_HOST=
|
||||
|
||||
:: determine the toolset and winapi for Boost b2
|
||||
:: optionally use 64bit toolset to work around memory errors when linking
|
||||
IF DEFINED VS_TOOLSET (
|
||||
set BOOST_TOOLSET=msvc-%BOOST_TOOLSET%
|
||||
if "!VS_TOOLSET:~-3!"=="_xp" (
|
||||
set BOOST_WIN_API=define=BOOST_USE_WINAPI_VERSION=0x0501
|
||||
)
|
||||
)
|
||||
IF NOT "%VS_HOST%"=="" (
|
||||
set VS_TOOLSET_HOST=%VS_TOOLSET%,host=%VS_HOST%
|
||||
)
|
||||
) ELSE (
|
||||
set BOOST_TOOLSET=msvc-%VC_VER%
|
||||
set BOOST_WIN_API=
|
||||
IF NOT "%VS_HOST%"=="" (
|
||||
set VS_TOOLSET_HOST=host=%VS_HOST%
|
||||
)
|
||||
)
|
||||
|
||||
IF %VS_PLATFORM%==Win32 (
|
||||
|
||||
Reference in New Issue
Block a user