From 318779196b27941b0e9fbaed7ba2e5fc22dc6e83 Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Thu, 5 Nov 2015 17:43:41 +0200 Subject: [PATCH] Use BuildDepsCache.txt to store information about used Python version so that it's available for "autonomic" run-cmake.bat runs. --- .gitignore | 1 + win/build-deps.cmd | 13 +++++++++++-- win/readme.txt | 6 ++---- win/run-cmake.bat | 17 ++++++++--------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index c8ab31c0d2..f58a70deae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ deps*/ build*/ install*/ +/win/BuildDepsCache.txt diff --git a/win/build-deps.cmd b/win/build-deps.cmd index 8b3c41a890..b60f92d990 100644 --- a/win/build-deps.cmd +++ b/win/build-deps.cmd @@ -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} ) diff --git a/win/readme.txt b/win/readme.txt index 0718d1cb5c..0b9b14c0a7 100644 --- a/win/readme.txt +++ b/win/readme.txt @@ -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- 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