Use BuildDepsCache.txt to store information about used Python version so that it's available for "autonomic" run-cmake.bat runs.

This commit is contained in:
Stinkfist0
2015-11-05 17:43:41 +02:00
parent 6190771817
commit 318779196b
4 changed files with 22 additions and 15 deletions
+1
View File
@@ -2,3 +2,4 @@
deps*/
build*/
install*/
/win/BuildDepsCache.txt
+11 -2
View File
@@ -24,6 +24,8 @@
@echo off
echo.
set THISDIR=%CD%
:: Enable the delayed environment variable expansion needed in vs-cfg.cmd.
setlocal EnableDelayedExpansion
@@ -271,10 +273,13 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
:Python
:: TODO Update to 3.5 when it's released as it will have an option to install debug libraries.
:: NOTE If updating the default Python version, change PY_VER_MAJOR_MINOR accordingly in run-cmake.bat
set PYTHON_VERSION=3.4.3
IF "%IFCOS_USE_PYTHON2%"=="TRUE" set PYTHON_VERSION=2.7.10
set PY_VER_MAJOR_MINOR=%PYTHON_VERSION:~0,3%
set PY_VER_MAJOR_MINOR=%PY_VER_MAJOR_MINOR:.=%
set PYTHONPATH=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
set DEPENDENCY_NAME=Python %PYTHON_VERSION%
set DEPENDENCY_DIR=N/A
set PYTHON_AMD64_POSTFIX=.amd64
@@ -283,6 +288,10 @@ IF NOT %TARGET_ARCH%==x64 set PYTHON_AMD64_POSTFIX=
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%>"%THISDIR%\BuildDepsCache.txt"
echo PYTHONPATH=%PYTHONPATH%>>"%THISDIR%\BuildDepsCache.txt"
cd "%DEPS_DIR%"
call :DownloadFile https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER% "%DEPS_DIR%" %PYTHON_INSTALLER%
IF NOT %ERRORLEVEL%==0 GOTO :Error
@@ -292,9 +301,9 @@ IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
msiexec /x %PYTHON_INSTALLER% /qn
)
IF NOT EXIST "%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%". (
IF NOT EXIST "%PYTHONPATH%". (
cecho {0D}Installing %DEPENDENCY_NAME%. Please be patient, this will take a while.{# #}{\n}
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR="%PYTHONPATH%"
) ELSE (
cecho {0D}%DEPENDENCY_NAME% already installed. Skipping.{# #}{\n}
)
+2 -4
View File
@@ -28,10 +28,7 @@ After the dependencies are build, execute run-cmake.bat. The batch file expects
is provided, the same default value as above is used. This batch script will create a folder of form
build-vs<VERSION>-<ARCHITECTURE> which will contain the solution and project files for Visual Studio.
IMPORTANT: If you wish to use any library from a custom location, modify the paths in run-cmake.bat
accordingly. If you used IFCOS_USE_PYTHON2=TRUE when running build-deps.cmd, currently it must also be
set accordingly before running run-cmake.bat, if run-cmake.bat is not run in the same command prompt
session as build-deps.cmd was run.
accordingly.
All of the dependencies are build as static libraries against the static run-time allowing the developer
to effortlessly deploy standalone binaries.
@@ -47,6 +44,7 @@ folder and the required IfcOpenShell-Python parts are deployed to the <PYTHONPAT
| readme.txt - This file
| run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS
| vs-cfg.cmd - Utility file used by the build scripts
| BuildDepsCache.txt - Cache file created by build-deps.cmd
|
+---sln - Contains the old Visual Studio solution and project files
\---utils - Contains various utilities for the build scripts
+8 -9
View File
@@ -25,6 +25,9 @@ set PROJECT_NAME=IfcOpenShell
:: Enable the delayed environment variable expansion needed in vs-cfg.cmd.
setlocal EnableDelayedExpansion
:: Read Python related variables from BuildDepsCache.txt
for /f "delims== tokens=1,2" %%G in (BuildDepsCache.txt) do set %%G=%%H
call vs-cfg.cmd %1
pushd ..
@@ -34,11 +37,6 @@ popd
set BUILD_DIR=build-vs%VS_VER%-%TARGET_ARCH%
IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
pushd ..\%BUILD_DIR%
:: TODO Duplicate code with build-deps.cmd: have some kind of build cache/config file and read Pyhon version from there.
set PYTHON_VERSION=3.4.3
IF "%IFCOS_USE_PYTHON2%"=="TRUE" set PYTHON_VERSION=2.7.10
set PY_VER_MAJOR_MINOR=%PYTHON_VERSION:~0,3%
set PY_VER_MAJOR_MINOR=%PY_VER_MAJOR_MINOR:.=%
set BOOST_ROOT=%DEPS_DIR%\boost
REM set BOOST_INCLUDEDIR=%DEPS_DIR%\boost
@@ -49,9 +47,10 @@ 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
set PYTHON_INCLUDE_DIR=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%\include
set PYTHON_LIBRARY=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%\libs\python%PY_VER_MAJOR_MINOR%.lib
set PYTHONPATH=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
if "%PY_VER_MAJOR_MINOR%"=="" set PY_VER_MAJOR_MINOR=34
if "%PYTHONPATH%"=="" set PYTHONPATH=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
set PYTHON_INCLUDE_DIR=%PYTHONPATH%\include
set PYTHON_LIBRARY=%PYTHONPATH%\libs\python%PY_VER_MAJOR_MINOR%.lib
set SWIG_DIR=%INSTALL_DIR%\swigwin
set PATH=%PATH%;%SWIG_DIR%;%PYTHONPATH%
:: TODO 3ds Max SDK?
@@ -71,9 +70,9 @@ 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%
echo PYTHONPATH = %PYTHONPATH%
echo PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR%
echo PYTHON_LIBRARY = %PYTHON_LIBRARY%
echo PYTHONPATH = %PYTHONPATH%
echo SWIG_DIR = %SWIG_DIR%
echo.
echo CMAKE_INSTALL_PREFIX = %CMAKE_INSTALL_PREFIX%