mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 23:11:00 +00:00
Add set-python-to-path.bat helper, add instructions for using preinstalled Python.
This commit is contained in:
@@ -39,6 +39,23 @@ parts are deployed to the `<PYTHONPATH>\Lib\site-packages\` folder.
|
|||||||
**Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer
|
**Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer
|
||||||
to effortlessly deploy standalone IFCOS binaries.
|
to effortlessly deploy standalone IFCOS binaries.
|
||||||
|
|
||||||
|
Using an already existing Python installation
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
Let's say you have already installed 64-bit Python 3.5.1 to `C:\Python3`.
|
||||||
|
Before building the dependencies, disable the script from installing Python:
|
||||||
|
```
|
||||||
|
> set IFCOS_INSTALL_PYTHON=FALSE
|
||||||
|
> buid-deps.cmd
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
Directory Structure
|
Directory Structure
|
||||||
------------------
|
------------------
|
||||||
@@ -55,6 +72,7 @@ Directory Structure
|
|||||||
| install-ifcopenshell.cmd - Builds IFCOS's INSTALL project
|
| install-ifcopenshell.cmd - Builds IFCOS's INSTALL project
|
||||||
| readme.md - This file
|
| readme.md - This file
|
||||||
| run-cmake.bat - Sets environment variables for the dependencies and runs CMake for IFCOS
|
| 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
|
||||||
| vs-cfg.cmd - Utility file used by the build scripts
|
| vs-cfg.cmd - Utility file used by the build scripts
|
||||||
+---sln - Contains the old Visual Studio solution and project files
|
+---sln - Contains the old Visual Studio solution and project files
|
||||||
\---utils - Contains various utilities for the build scripts
|
\---utils - Contains various utilities for the build scripts
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
:: ::
|
||||||
|
:: This file is part of IfcOpenShell. ::
|
||||||
|
:: ::
|
||||||
|
:: IfcOpenShell is free software: you can redistribute it and/or modify ::
|
||||||
|
:: it under the terms of the Lesser GNU General Public License as published by ::
|
||||||
|
:: the Free Software Foundation, either version 3.0 of the License, or ::
|
||||||
|
:: (at your option) any later version. ::
|
||||||
|
:: ::
|
||||||
|
:: IfcOpenShell is distributed in the hope that it will be useful, ::
|
||||||
|
:: but WITHOUT ANY WARRANTY; without even the implied warranty of ::
|
||||||
|
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ::
|
||||||
|
:: Lesser GNU General Public License for more details. ::
|
||||||
|
:: ::
|
||||||
|
:: You should have received a copy of the Lesser GNU General Public License ::
|
||||||
|
:: along with this program. If not, see <http://www.gnu.org/licenses/>. ::
|
||||||
|
:: ::
|
||||||
|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||||
|
|
||||||
|
:: Pass x86 or x64 as %1, if not specified x64 assumed.
|
||||||
|
|
||||||
|
@echo off
|
||||||
|
set TARGET_ARCH=%1
|
||||||
|
if "%TARGET_ARCH%"=="" set TARGET_ARCH=x64
|
||||||
|
if not exist BuildDepsCache-%TARGET_ARCH%.txt. (
|
||||||
|
echo BuildDepsCache-%TARGET_ARCH%.txt does not exist
|
||||||
|
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
|
||||||
|
goto :EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
echo %PYTHONPATH% set to PATH
|
||||||
|
set PATH=%PYTHONPATH%;%PATH%
|
||||||
Reference in New Issue
Block a user