|
Installation
Prerequisites
Check-out the CGAL installation manual pages for more details. Check-out the SWIG web site for more details. Step-By-Step Installation Guide
An in-source build indicates the fact that the CGAL bindings are compiled from the root of the project (that is to say from CGAL_BINDINGS_ROOT). In that case all temporary files are generated in the source tree. This prevents building the cgal bindings with different compiler options for example. An out-of-source build indicates the fact that the CGAL bindings are compiled from a dedicated directory (for example CGAL_BINDINGS_ROOT/build/CGAL-3.9_release). This type of build allows several different builds. Path to the file CGALConfig.cmake created when installing/compiling CGAL. For Debian and Ubunto packages, it is /usr/lib/CGAL for example. States whether Java bindings should be generated. The default value is ON. States whether Python bindings should be generated. The default value is ON. Java specific files output directory prefix; Java files and libraries will be respectively generated into JAVA_OUTDIR_PREFIX/CGAL and JAVA_OUTDIR_PREFIX/lib directories. The default is CURRENT_PATH/build-java. Python specific files output directory prefix; Python files and libraries will be generated into PYTHON_OUTDIR_PREFIX/CGAL directory. The default is CURRENT_PATH/build-python. Path where libraries common to all target languages are generated. The default is CURRENT_PATH/lib. Full example: > git clone https://code.google.com/p/cgal-bindings
> cd cgal-bindings
> mkdir build/CGAL-3.9_release -p
> cd build/CGAL-3.9_release
> cmake -DCGAL_DIR=/usr/lib/CGAL -DBUILD_PYTHON=OFF -DJAVA_OUTDIR_PREFIX=../../examples/java ../..
> make -j 4
> cd ../../examples/java
> javac test_kernel.java
> export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:lib
> java test_kernel
... output of the example test_kernel.java ...
|
► Sign in to add a comment
To build on Mac OS X (10.7.3), I need to specify the C/C++ compiler explicitly. I'm using Python 2.7 and Java 1.6
CC=llvm-gcc CXX=llvm-g++ cmake -DCGAL_DIR=../CGAL-4.0 -DBUILD_PYTHON=ON -DBUILD_JAVA=ON -DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES .
For Java examples on OS X, I need to specify the Java classpath when compiling, and also set DYLD_LIBRARY_PATH (rather than LD_LIBRARY_PATH) when executing, e.g.:
cd examples/java export CLASSPATH=.:/Users/pds/tools/cgal-bindings/build-java/ javac test_kernel.java export DYLD_LIBRARY_PATH=/Users/pds/tools/cgal-bindings/build-java/lib java test_kernelFor Python examples, I set the Python search path using:
cd examples/python export PYTHONPATH=/Users/pds/tools/cgal-bindings/build-python/ python test_aabb.py