Make possible to switch between Python 2 & 3 easily. Fixes also possible confusion when having both 32-bit and 64-bit Python installations side by side.

This commit is contained in:
Stinkfist0
2015-11-03 16:06:20 +02:00
parent 7b4d8734ed
commit 26ed16ba52
4 changed files with 64 additions and 12 deletions
+4 -2
View File
@@ -282,6 +282,8 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
:: TODO Update to 3.5 when it's released as it will have an option to install debug libraries.
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 DEPENDENCY_NAME=Python %PYTHON_VERSION%
set DEPENDENCY_DIR=N/A
set PYTHON_AMD64_POSTFIX=.amd64
@@ -299,9 +301,9 @@ IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
msiexec /x %PYTHON_INSTALLER% /qn
)
IF NOT EXIST "%INSTALL_DIR%\Python". (
IF NOT EXIST "%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%". (
cecho {0D}Installing %DEPENDENCY_NAME%. Please be patient, this will take a while.{# #}{\n}
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR=%INSTALL_DIR%\Python
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
) ELSE (
cecho {0D}%DEPENDENCY_NAME% already installed. Skipping.{# #}{\n}
)
+4 -1
View File
@@ -28,7 +28,10 @@ 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.
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.
All of the dependencies are build as static libraries against the static run-time allowing the developer
to effortlessly deploy standalone binaries.
+13 -2
View File
@@ -27,11 +27,18 @@ setlocal EnableDelayedExpansion
call vs-cfg.cmd %1
set CMAKE_INSTALL_PREFIX=%CD%\..\installed-vs%VS_VER%-%TARGET_ARCH%
pushd ..
set CMAKE_INSTALL_PREFIX=%CD%\installed-vs%VS_VER%-%TARGET_ARCH%
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
@@ -42,7 +49,9 @@ 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 PYTHONPATH=%INSTALL_DIR%\Python
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%
set SWIG_DIR=%INSTALL_DIR%\swigwin
set PATH=%PATH%;%SWIG_DIR%;%PYTHONPATH%
:: TODO 3ds Max SDK?
@@ -62,6 +71,8 @@ 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 PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR%
echo PYTHON_LIBRARY = %PYTHON_LIBRARY%
echo PYTHONPATH = %PYTHONPATH%
echo SWIG_DIR = %SWIG_DIR%
echo.