Build

dbarbier edited this page Nov 19, 2014 · 13 revisions

Sources have been successfully built on Windows, Mac and Linux platforms, with different compilers. If you have trouble, please let us know.

You must install CMake, at least version 2.6. CMake also comes with a graphical user interface, you may want to use it if you are not familiar with CMake.

With CMake graphical user interface (any OS)

  1. Select the directory containing OCE source code

  2. Select the directory where you want to build the binaries. You should not use the same directory as the source directory; it is easier to clean up everything by removing a dedicated directory.

  3. Click on the Configure button. If the build directory does not exist, CMake asks whether to create it. If you decline, nothing is done and you have to set another build directory. Otherwise, CMake asks which generator to use. The list of generators depend on your operating system. If you do not know which one to choose, the default is probably the best bet.

  4. Click on the Finish button. Lots of lines will get displayed, and if everything works fine, you are presented with a list of configuration options.

  5. Change any option you want (see table below), and click again on the Configure button to take them into account. You can repeat this step as many times as you want.

  6. When you are happy with options, click on the Generate button. Files will be generated by CMake to run the the generator selected at step 3.

  7. Build OCE with the selected generator.

With CMake command-line (on Unix)

mkdir build
cd build
cmake -DOCE_INSTALL_PREFIX:PATH=$HOME/OCE  \
    -DOCE_WITH_FREEIMAGE:BOOL=ON \
    -DOCE_WITH_GL2PS:BOOL=ON \
    -DOCE_DRAW:BOOL=ON \
    ..
make
make install/strip

Build OCE on Mac OSX

You can read the tutorial here: Build (Mac OSX)

List of available options

Standard CMake options

Option Type Default Details
OCE_BUILD_SHARED_LIB boolean ON When set, build shared libraries. Otherwise, build static libraries.
OCE_INSTALL_PREFIX path /usr/local on Unix, c:/oce-1.0 on Windows Choose installation root path.

Components to build

Option Type Default Details
OCE_MODEL boolean ON Build model components.
OCE_DATA_EXCHANGE boolean ON Build data exchange components.
OCE_OCAF boolean ON Build application framework.
OCE_VISUALIZATION boolean ON Build visualization components.
OCE_DRAW boolean OFF Build test harness (DRAW).

Optional 3rd-party libraries

Option Type Default Details
OCE_MULTITHREAD_LIBRARY string NONE Few components are multithreaded; one can select TBB or OPENMP to take advantage of these multithread libraries.
OCE_TBB_MALLOC_SUPPORT boolean ON This option is visible only if OCE_MULTITHREAD_LIBRARY is set to TBB. It allows using TBB for memory allocation.
OCE_WITH_FREEIMAGE boolean OFF Build with FreeImage support. When visualization components are enabled, some methods are provided to dump a window into a file. By default, only PPM format is supported. Building with FreeImage adds more efficient pixmap formats (PNG, GIF, JPEG, etc).
OCE_WITH_GL2PS boolean OFF Build with FreeImage support. When visualization components are enabled, some methods are provided to dump a window into a file. By default, only PPM format is supported. Building with gl2ps adds vectorial formats (PS, PDF, SVG, etc).