Build instructions and PCRE lib dir (#120)

* CMakeLists.txt: show fatal error if PCRE not found if COLLADA_SUPPORT is on.

* Compiling on *nix instruction tweaks.
This commit is contained in:
Ali Kämäräinen
2016-08-22 12:45:37 +03:00
committed by Thomas Krijnen
parent 8dadb71648
commit e064098f84
2 changed files with 17 additions and 20 deletions
+12 -18
View File
@@ -88,14 +88,14 @@ for additional information):
$ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev $ sudo apt-get install liboce-foundation-dev liboce-modeling-dev liboce-ocaf-dev liboce-visualization-dev liboce-ocaf-lite-dev
If not, you will need to compile Open CASCADE yourself: If not, you will need to compile Open CASCADE yourself (note that the build takes a long time):
$ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev $ sudo apt-get install libftgl-dev libtbb2 libtbb-dev libgl1-mesa-dev libfreetype6-dev
$ git clone https://github.com/tpaviot/oce.git $ git clone https://github.com/tpaviot/oce.git
$ cd oce $ cd oce
$ mkdir build && cd build $ mkdir build && cd build
$ cmake .. $ cmake ..
$ make $ make -j
$ sudo make install $ sudo make install
For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed: For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA is needed:
@@ -107,30 +107,24 @@ For building IfcConvert with COLLADA (.dae) support (on by default), OpenCOLLADA
$ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6 $ git checkout 064a60b65c2c31b94f013820856bc84fb1937cc6
$ mkdir build && cd build $ mkdir build && cd build
$ cmake .. $ cmake ..
$ make $ make -j
$ sudo make install $ sudo make install
For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available: For building the IfcPython wrapper (on by default), SWIG and Python development are needed, if not already available:
$ sudo apt-get install python-all-dev swig $ sudo apt-get install python-all-dev swig
To build IfcOpenShell please take the following steps: To build IfcOpenShell please take the following steps. Alternatively use environment variables for setting the
dependencies' paths. `OCC_INCLUDE_DIR` might be needed to set also. `OPENCOLLADA_INCLUDE_DIR` and `OPENCOLLADA_LIBRARY_DIR`
(and potentially `PCRE_LIBRARY_DIR`) are needed if building with COLLADA support. (`-DCOLLADA_SUPPORT=0` disables it).
$ cd /path/to/IfcOpenShell $ cd /path/to/IfcOpenShell
$ mkdir build $ mkdir build && cd build
$ cd build $ cmake ../cmake -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/ \
Optionally, if required: -DOPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada" \
$ OCC_INCLUDE_PATH="/path/to/OpenCASCADE/include" -DOPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada" \
$ OCC_LIBRARY_PATH="/path/to/OpenCASCADE/lib" -DPCRE_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu/
$ export OCC_INCLUDE_PATH $ make -j
$ export OCC_LIBRARY_PATH
If building with COLLADA support (path might vary):
$ OPENCOLLADA_INCLUDE_DIR="/usr/local/include/opencollada"
$ OPENCOLLADA_LIBRARY_DIR="/usr/local/lib/opencollada"
$ export OPENCOLLADA_INCLUDE_DIR
$ export OPENCOLLADA_LIBRARY_DIR
$ cmake ../cmake
$ make
If all worked out correctly you can now use IfcOpenShell. See the examples below. If all worked out correctly you can now use IfcOpenShell. See the examples below.
+3
View File
@@ -263,6 +263,9 @@ IF(COLLADA_SUPPORT)
if (pcre_library) if (pcre_library)
SET(OPENCOLLADA_LIBRARY_DIR ${OPENCOLLADA_LIBRARY_DIR} ${PCRE_LIBRARY_DIR}) SET(OPENCOLLADA_LIBRARY_DIR ${OPENCOLLADA_LIBRARY_DIR} ${PCRE_LIBRARY_DIR})
list(APPEND OPENCOLLADA_LIBRARIES "${pcre_library}") list(APPEND OPENCOLLADA_LIBRARIES "${pcre_library}")
else()
message(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find PCRE. "
"Disable COLLADA_SUPPORT or fix PCRE_LIBRARY_DIR path to proceed.")
endif() endif()
IF(MSVC) IF(MSVC)