Add set-python-to-path.bat helper, add instructions for using preinstalled Python.

This commit is contained in:
Stinkfist0
2016-01-19 17:03:05 +02:00
parent 18e451b874
commit c7bf03e8f8
2 changed files with 55 additions and 1 deletions
+19 -1
View File
@@ -32,13 +32,30 @@ easily more than 2 GBs of RAM while converting.
After this, one can build the project using the `IfcOpenShell.sln` file in the build folder. Build the `INSTALL` project
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
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.
**Note:** All of the dependencies are build as static libraries against the static run-time allowing the developer
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
------------------
@@ -55,6 +72,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
| 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
+36
View File
@@ -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%