Note that the installation requires significant disk space. Make sure to free enough disk space before the installation.
Instructions on adding Environment Variables in Windows are at the end.
INSTALLATION:
In parentheses are the paths on my computer.
1) Visual C++ 2010:
- If you use the offline version choose to install Visual C++.
- Accept the license terms.
- You may select a custom installation (instead of full) and select only Visual C++ (unselect other features).
- Don't install "SQL Server" & "Silverlight Runtime" (you can if you want...)
- There is a chance that it is recommended to reboot now.
2) Boost
- No easy offline install.
- Agree to both licenses.
- Nearest SourceForge mirror.
- Choose "Visual C++ 10.0 (Visual Studio 2010)" and the following variants:
- Don't forget to check the "Add to path"
- Install
3) CMake
- Agree to the license.
- Check "Add CMake to the system PATH for all users". We can check "create desktop icon".
- Next, Next, Next.
- Finish
4) QT
- Agree to the license.
- Next, Next, Next, Install.
- Add QTDIR variable with the value C:\Qt\4.8.4 to the environment variables (if it's not already there).
- Add <QT>\bin to the system PATH. (C:\Qt\4.8.4\bin)
4.1) QT Visual Studio 2010 addin:
- install the addin (works only in VS2010 Professional edition)
5) CGAL
- CGAL installation will need to connect to the internet for GMP and MPFR.
- Be amazed by the splash screen.
- Agree to the license.
- Just choose the default: with GMP and MPFR, and with examples and demos.
- 32-bit (for me).
- In the "Setting Environment Variables" screen, choose all users and make sure that CGAL_DIR is checked.
- Install.
- Add <CGAL_DIR >\auxiliary\gmp\lib to the system PATH. (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\lib)
Now you need to compile CGAL
- Open CMake - cmake-gui (on the Desktop) - if you are using win7 make sure you open the program in administrator mode - right click on the icon and click on "run as administrator".
- For both "Where is the source code" and "Where to build the binaries" specify the CGAL Installation folder (C:\Program Files\CGAL-4.2-beta1)
- Click Configure.
- Choose "Visual Studio 10 2010" and click "Finish"
- Click Generate
- A solution named CGAL was created in the directory.
- Compile ALL_BUILD project both in Debug and Release (ignore the compilation error in CGAL_imageIO).
- All CGAL libraries should be under the lib directory.
6) Sanity check (optional)
- Open CMake (cmake-gui, can be found on the desktop) - (for win7 users, use "Run as admin")
- Choose "Where is the source code:" to be the Triangulation_2 demo directory under the CGAL installation. Namely, <CGAL>/demo/Triangulation_2 (C:\Program Files\CGAL-4.2-beta1/demo/Triangulation_2).
- Choose "Where to build the binaries:" to the same directory.
- Click Configure
- Click Generate
- Go to the directory (C:\Program Files\CGAL-4.2-beta1) and open the solution and compile. Run the Delaunay_triangulation project for check (in debug and release)
7) Customizing env - If you are not using CMake to create new VS projects
Note: the following operations should be repeated for the Debug and Release modes
- Right-click on the selected project and select "Properties".
Go to C/C++ -> General . Add the following to "Additional Include Directories" (include)
* include: <Boost> (C:\Program Files\boost\boost_1_50)
* include: <CGAL>\include (C:\Program Files\CGAL-4.2-beta1\include)
* include: <CGAL>\auxiliary\gmp\include (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\include)
* include: <QT>\include\Qt (C:\Qt\4.8.4\include\Qt)
* include: <QT>\include\QtCore (C:\Qt\4.8.4\include\QtCore)
* include: <QT>\include\QtGui (C:\Qt\4.8.4\include\QtGui)
Go to Linker -> General. Add the following to "Additional Dependencies" (include)
* library: <CGAL>\lib (C:\Program Files\CGAL-4.2-beta1\lib)
* library: <QT>\lib (C:\Qt\4.8.4\lib)
* library: <Boost>\lib (C:\Program Files\boost\boost_1_50\lib)
* library: <CGAL>\auxiliary\gmp\lib (C:\Program Files\CGAL-4.2-beta1\auxiliary\gmp\lib)
For a specific project using CGAL you need to ignore the auto-link of gmp and mpfr. The names below are for Debug.
- Linker -> Input
* Add libgmp-10.lib and libmpfr-4.lib to "Additional Dependencies"
* Add gmp-vc100-mt-gd.lib and mpfr-vc100-mt-gd.lib to "Ignore Specific Library" (gmp-vc100-mt.lib and mpfr-vc100-mt.lib in release mode).
For a specific project using QT:
- Linker -> Input
* Add qtmaind.lib, QtGuid4.lib, and QtCored4.lib to "Additional Dependencies" (qtmain.lib;QtCore4.lib;QtGui4.lib in release).
Important: In case that the compilation succeeds but the linker is unable to find cgal-related dlls ("the program can't start because cgal-vc100-mt-gd-4.2.dl is missing")
find these files in the CGAL directory and copy them either to the system32 folder of windows, or the folder of the visual studio project.
Try to compile this programs:
Hello CGAL: http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Introduction/Chapter_main.html