Reputation: 161
I have installed CGAL using macports. I run CMake on an example and its running fine. So I tried to create a new project and pasted the code I needed from an example. So I have not link the CGAL libraries yet and unable to run the code. Im not sure how to link it in the build settings. Hope someone can guide me through.
Im trying to run the envelope2.cpp.
Upvotes: 6
Views: 2080
Reputation: 9380
You mentioned MacPorts but here are instructions for Homebrew. They should be pretty similar but you might need to alter some of the paths from /usr/local
to /opt/local
.
brew install cgal
Build Settings
tab.All
filter.header search
and you'll find the right setting:
Header Search Paths
+
button on the detail popup:
/usr/local/include/
.General
tab.Linked Frameworks and Libraries
section click the +
button:
Add Other...
button and you'll get an open file dialog.Option + /
to go to a specific a directory:
/usr/local/lib
, and click Go
.Command
while clicking to select more than one at at time):
libboost_thread-mt.dylib
libCGAL.dylib
libCGAL_Core.dylib
libgmp.dylib
libmpfr.dylib
Upvotes: 8
Reputation: 9090
When cgal
is installed on the system, the example example/Envelope_2
(contains a CMakeLists.txt
file) can be run like this:
cmake .
make
./convex_hull
Or for an out-of-source build:
mkdir build
cd build
cmake ..
make
mv ../ch_points.dat .
./convex_hull
This is on OS X with cgal
installed using brew, which installs into /usr/local/...
. With MacPorts there may be a problem because it installs the third-party packages into /opt
.
According to How do I instruct CMake to look for libraries installed by MacPorts? , adding the following to the CMakeLists.txt
file (before find_package
) may help:
list(APPEND CMAKE_LIBRARY_PATH /opt/local/lib)
list(APPEND CMAKE_INCLUDE_PATH /opt/local/include)
Upvotes: 0