mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Replace PYTHONPATH with PYTHONHOME
This commit is contained in:
+4
-4
@@ -253,7 +253,7 @@ 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 PYTHONHOME=%INSTALL_DIR%\Python%PY_VER_MAJOR_MINOR%
|
||||
|
||||
set DEPENDENCY_NAME=Python %PYTHON_VERSION%
|
||||
set DEPENDENCY_DIR=N/A
|
||||
@@ -265,7 +265,7 @@ set PYTHON_INSTALLER=python-%PYTHON_VERSION%%PYTHON_AMD64_POSTFIX%.msi
|
||||
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\BuildDepsCache-%TARGET_ARCH%.txt"
|
||||
echo PYTHONPATH=%PYTHONPATH%>>"%~dp0\BuildDepsCache-%TARGET_ARCH%.txt"
|
||||
echo PYTHONHOME=%PYTHONHOME%>>"%~dp0\BuildDepsCache-%TARGET_ARCH%.txt"
|
||||
|
||||
cd "%DEPS_DIR%"
|
||||
call :DownloadFile https://www.python.org/ftp/python/%PYTHON_VERSION%/%PYTHON_INSTALLER% "%DEPS_DIR%" %PYTHON_INSTALLER%
|
||||
@@ -276,9 +276,9 @@ IF "%IFCOS_INSTALL_PYTHON%"=="TRUE" (
|
||||
msiexec /x %PYTHON_INSTALLER% /qn
|
||||
)
|
||||
|
||||
IF NOT EXIST "%PYTHONPATH%". (
|
||||
IF NOT EXIST "%PYTHONHOME%". (
|
||||
call cecho.cmd 0 13 "Installing %DEPENDENCY_NAME%. Please be patient, this will take a while."
|
||||
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR="%PYTHONPATH%"
|
||||
msiexec /qn /i %PYTHON_INSTALLER% TARGETDIR="%PYTHONHOME%"
|
||||
) ELSE (
|
||||
call cecho.cmd 0 13 "%DEPENDENCY_NAME% already installed. Skipping."
|
||||
)
|
||||
|
||||
+3
-3
@@ -40,7 +40,7 @@ After this, one can build the project using the `IfcOpenShell.sln` file in the b
|
||||
if wanted. Convenience batch files `build-ifcopenshell.cmd` and `install-ifcopenshell.cmd` can also be used. The batch files
|
||||
expect `%1` and `%2` in same fashion as above and possible extra parameters are passed for the `MSBuild` call. The project will
|
||||
be installed to `installed-vs<VERSION>-<ARCHITECTURE>\` folder in the project's root folder and the required IfcOpenShell-Python
|
||||
parts are deployed to the `<PYTHONPATH>\Lib\site-packages\` folder.
|
||||
parts are deployed to the `<PYTHONHOME>\Lib\site-packages\` folder.
|
||||
|
||||
**Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer
|
||||
to effortlessly deploy standalone IFCOS binaries.
|
||||
@@ -58,7 +58,7 @@ Before building the dependencies, disable the script from installing Python:
|
||||
After bulding the dependencies, create BuildDepsCache file to `IfcOpenShell\win` which tells the used Python version and intallation directory:
|
||||
```
|
||||
> echo PY_VER_MAJOR_MINOR=35> BuildDepsCache-x64.txt
|
||||
> echo PYTHONPATH=C:\Python3>> BuildDepsCache-x64.txt
|
||||
> echo PYTHONHOME=C:\Python3>> BuildDepsCache-x64.txt
|
||||
```
|
||||
|
||||
After this you should be able to run `run-cmake.bat` normally. If using 32-bit Python, the name of the file must be `BuildDepsCache-x86.txt`.
|
||||
@@ -80,7 +80,7 @@ Directory Structure
|
||||
| install-ifcopenshell.cmd - Builds IFCOS's INSTALL project
|
||||
| readme.md - This file
|
||||
| run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS
|
||||
| set-python-to-path.bat - Utility for setting PYTHONPATH (read from BuildDepsCache-<ARCH>.txt) to PATH
|
||||
| set-python-to-path.bat - Utility for setting PYTHONHOME (read from BuildDepsCache-<ARCH>.txt) to PATH
|
||||
| vs-cfg.cmd - Utility file used by the build scripts
|
||||
+---sln - Contains the old Visual Studio solution and project files
|
||||
\---utils - Contains various utilities for the build scripts
|
||||
|
||||
+6
-6
@@ -53,12 +53,12 @@ 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
|
||||
if not defined PY_VER_MAJOR_MINOR set PY_VER_MAJOR_MINOR=34
|
||||
if not defined 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 PYTHON_EXECUTABLE=%PYTHONPATH%\python.exe
|
||||
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
|
||||
set SWIG_DIR=%INSTALL_DIR%\swigwin
|
||||
set PATH=%PATH%;%SWIG_DIR%;%PYTHONPATH%
|
||||
set PATH=%PATH%;%SWIG_DIR%;%PYTHONHOME%
|
||||
:: TODO 3ds Max SDK?
|
||||
|
||||
echo.
|
||||
@@ -75,7 +75,7 @@ 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 PYTHONHOME = %PYTHONHOME%
|
||||
echo PYTHON_INCLUDE_DIR = %PYTHON_INCLUDE_DIR%
|
||||
echo PYTHON_LIBRARY = %PYTHON_LIBRARY%
|
||||
echo PYTHON_EXECUTABLE = %PYTHON_EXECUTABLE%
|
||||
|
||||
@@ -27,10 +27,10 @@ if not exist BuildDepsCache-%TARGET_ARCH%.txt. (
|
||||
goto :EOF
|
||||
)
|
||||
for /f "delims== tokens=1,2" %%G in (BuildDepsCache-%TARGET_ARCH%.txt) do set %%G=%%H
|
||||
if not defined PYTHONPATH (
|
||||
echo PYTHONPATH PYTHONPATH not defined
|
||||
if not defined PYTHONHOME (
|
||||
echo PYTHONHOME PYTHONHOME not defined
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
echo %PYTHONPATH% set to PATH
|
||||
set PATH=%PYTHONPATH%;%PATH%
|
||||
echo %PYTHONHOME% set to PATH
|
||||
set PATH=%PYTHONHOME%;%PATH%
|
||||
|
||||
Reference in New Issue
Block a user