Download CGAL for Windows

Build from Source

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.

Installing CGAL



General Prerequisites

Prerequisites for Building the 32-bit CGAL Library using Microsoft Visual Studio 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.67.

   I download and run the file boost_1_67_0-msvc-xx.0-32.exe (where xx = 12 for 2013)

   I choose to extract the files to a new directory c:\dev\libboost_1_67_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_67_0\lib32-msvc-xx.0
  BOOST_INCLUDEDIR=C:\dev\libboost_1_67_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_67_0\lib32-msvc-xx.0

Qt 5

   I select 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.

Prerequisites for Building the 64-bit CGAL Library Using Microsoft Visual Studio 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

For the 64-bit version of Qt 5, the only available installer is for Visual Studio 2013, and the instructions are the same as described for 32-bit version. For other versions of Visual Studio, please refer to these instructions: https://doc.qt.io/qt-5/build-sources.html.

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.12 as installation directory

You now need to compile CGAL.

   I set C:\dev\CGAL-4.12 for source and C:\dev\CGAL-4.12\build as binaries
   I add to my PATH C:\dev\CGAL-4.12\build\bin

You can choose not to build CGAL libraries, but use it in header-only mode by checking CGAL_HEADER_ONLY while configuring CGAL with cmake-gui.

Building an Example

Examples do not need Qt 5.

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

   I set it to "C:\dev\CGAL-4.12\build-example\Convex_hull_2"
   I open the file C:\dev\CGAL-4.12\build-examples\Convex_hull_2\Convex_hull_2_example.sln with Visual Studio
   I open the C:\dev\CGAL-4.12\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.

   I set it to C:\dev\CGAL-4.12\demo\Triangulation_3
   I set it to "C:\dev\CGAL-4.12\build-demo\Triangulation_3"
   I open the file C:\dev\CGAL-4.12\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