CGAL (Computational Geometry Algorithms Library) is a useful library for CAD/CAE/CAM users and developers. Below is a step-by-step tutorial on how to install CGAL in your windows system.
- Download the CGAL source code here. In this example, I choose Windows platform and Visual C++ as the IDE. If you are a lazy bird, you might try below links directly.
- If you download the setup.exe and run it, it is easy to extract it via the wizard:
- Now the story just begins, we have to build CGAL from the source, either extracted as shown above using CGAL-4.0.2-Setup.exe or manually unpacked from CGAL-4.0.2.zip. To build the source for Visual Studio, we need cmake, a cross-platform, open-source build system.You can download CMAKE here or go directly with the direct link of windows version.
- Yup, you need install it! Skipped, coz trivial,
- Now, open a cmd window and cd to the directory you have installed/extracted CGAL:
This activates the cmake-gui and takes the current directory “.” as the parameter.
- CMake is fired with the highlighted info automatically filled:
- Press configure button above, the configuration window pops, select the generator as below, click finish.
- It takes a while to configure CMAKE to build CGAL. But wait, you might find some errors pop up: in this case, it complains that Boost library is not found. It is recommended to download the setup installer for Boost 1.4.7, follow the setup wizard, you will be there!
- Unpack this boost zip file, and click “Add Entry” and add a “BOOST_ROOT” option and point it to the boost installation folder:
- Re-click the configure button. Most likely, you will succeed. In rare cases, after installation of boost 1.4.7, reboot, and then repeat from step 5 on. Now, success!
- Press Generate button, and all the Visual Studio 2010 solution/project files are generate!
Happy coding!
Filed under: Programming
