Download CGAL for Windows

To build CGAL from source on Windows you have to download an installer or tarball or you can clone the current development version of CGAL from GitHub. Below are the installation instructions for the installer.

Please note that the directory layout and build process of the development version on GitHub are different from the release version.

General Prerequisites

Prerequisites for Building the 32-bit CGAL Library using Microsoft Visual Studio 2010/2012/2013

Boost

The 32-bit and 64-bits binary versions of Boost are available on SourceForge.

The installers install both boost headers and precompiled libraries. Please note that the CGAL project is not responsible for the files provided on this web site. At the moment these lines were written, the latest version was 1.59.

   I download and run the file boost_1_59_0-msvc-xx.0-32.exe (where xx = 10 for MSVC 2010, 11 for 2012, 12 for 2013)

   I choose to extract the files to a new directory c:\dev\libboost_1_59_0
  

You then need to set the following two environment variables to point respectively to the path of the libraries and the headers

  BOOST_LIBRARYDIR=C:\dev\libboost_1_59_0\lib32-msvc-xx.0
  BOOST_INCLUDEDIR=C:\dev\libboost_1_59_0

You also need to add the path to the Boost dll files in your PATH environment variable:

   I add to my PATH environment variable C:\dev\libboost_1_59_0\lib32-msvc-xx.0

Qt 5

   I selected C:\Qt\Qt5.5.1 so QTDIR is set to C:\Qt\Qt5.5.1
   I add C:\Qt\Qt5.5.1\5.5\msvcXXXX_XX\bin to my PATH

To avoid any conflict with another dll with the same name from another folder, add this path as the first in the list.

libQGLViewer

   I extract the sources in C:\dev, a new directory is created C:\dev\libQGLViewer-2.6.3
   I do cd C:\dev\libQGLViewer-2.6.3\QGLViewer
   I do:
  qmake.exe
  nmake
   I add C:\dev\libQGLViewer-2.6.3\QGLViewer to my PATH
   I set the environment variable QGLVIEWERROOT to C:\dev\libQGLViewer-2.6.3

Prerequisites for Building the 64-bit CGAL Library Using Microsoft Visual Studio 2010/2012/2013

Boost

The procedure for getting Boost is the same as described for the 32-bit version, but all "32" must be replaced by "64".

Qt 5

libQGLViewer

The procedure is the same as for the 32-bit version, except that you should use the x64 Visual Studio Command Prompt.

Building CGAL

Run the installer and select the version you want to install (this is only used to download the precompiled GMP and MPFR).

   I choose C:\dev\CGAL-4.7 as installation directory

You now need to compile CGAL.

   I set C:\dev\CGAL-4.7 for source and C:\dev\CGAL-4.7\build as binaries
   In the directory C:\dev\CGAL-4.7\build a solution file named CGAL.sln has been created
   I add to my PATH C:\dev\CGAL-4.7\build\bin

Building an Example

Examples need neither Qt 5, nor libQGLViewer

   I set it to C:\dev\CGAL-4.7\example\Convex_hull_2

   I set it to "C:\dev\CGAL-4.7\build-example\Convex_hull_2"
   I open the file C:\dev\CGAL-4.7\build-examples\Convex_hull_2\Convex_hull_2_example.sln with Visual Studio
   I open the C:\dev\CGAL-4.7\build-examples\Convex_hull_2\ch_timing.exe (the window automatically closes if not run from the console).

Building a Demo

All demos need Qt 5, and the 3D demos need libQGLViewer.

   I set it to C:\dev\CGAL-4.7\demo\Triangulation_3

   I set it to "C:\dev\CGAL-4.7\build-demo\Triangulation_3"
   I open the file C:\dev\CGAL-4.7\build-demo\Triangulation_3\Triangulation_3.sln with Visual Studio

Appendix: How to Set the PATH Variable or Other Environment Variables on Windows Systems

From the desktop, right-click My Computer and click properties (on Vista/Win7 click Advanced system settings on the left side).

   C:\Program Files;C:\Winnt;C:\Winnt\System32