How to compile CGAL from source on Windows 64-bit machine

This is a tutorial on how to build CGAL from source on a windows 64-bit machine. Hope it could help you guys

CGAL library

CMake installation

Download CMake from this link. In this tutorial, we install the latest version cmake-3.9.3-win64-x64.msi. Click Next Click Agree and add CMake to the system Select PATH for all users Click Next Click Next Click Install Click Finish

CMake Installation
Click next

Click add CMake to the system Select PATH for all users

Then start the installation process

Click Install

Then we wait for the installation to complete

CMake installation is completed

Qt5 installation

Download and execute qt-opensource-windows-x86-5.9.1.exe from [link] .

Install and configure Boost

Install

Download from this URL. In this tutorial we use the version of 1.65.1. To save time, please download boost_1_65_1-msvc-14.1-64.exe since it’s much faster. During installation, click Next and start the Installation progress. Finish with clicking Finish.

Use the default folder
Installation process
Click finish

Configuration

Let’s set environment variables.

Right-click on Windows mark → System → Advanced system settings → Click New (N) in Advanced tab, then click Add environment variables. (Example: BOOST_INCLUDEDIR) Also, add to the already existing PATH . To do this, select the variable Path and click Edit. Insert and add to the back of an already existing variable . When everything is finished, press OK to finish. Even if you make a mistake, do not delete the contents of the existing Path.

Environment Variables

Fill in the following lines

BOOST_LIBRARYDIR=C:\local\boost_1_65_1\lib64-msvc-14.1
BOOST_INCLUDEDIR=C:\local\boost_1_65_1

alt_text

C:\local\boost_1_65_1\lib64-msvc-14.1

CGAL installation

CGAL download and installation

https://www.cgal.org/download.html

https://github.com/CGAL/cgal/releases

Download and execute CGAL-4.11-Setup.exe. Next Agree Personally, I also want HTML Manual, so check all and click Next. Select 64bit. Make the directory C: \ local \ the same as Boost. (Somehow) I made it all users. The others are not changed. Once complete, Next Downloading is complete, so compile with CMake. This came out. In my environment, gmp was not included in the environment variable, so I will set it later.

alt_text

alt_text

alt_text

alt_text

alt_text

C:\local\CGAL-4.11

alt_text

alt_text

alt_text

Configuration

Let Source code be and Build the binaries be. Press Configure.

C:/local/CGAL-4.11

C:/local/CGAL-4.11/build

alt_text

Here, select Visual studio 15 2017 Win64 and click Finish.

alt_text

t turns red, but it is not an error because it is DONE. Click Generate.

alt_text

Since CGAL.sln appears in C: \ local \ CGAL-4.11 \ build, it opens with VS2017. Among these, build ALL_BUILD only. Output such as (Rebuild only the project) is output.

alt_text

When this is complete, add “C: \ local \ CGAL-4.11 \ build \ bin” and “C: \ local \ CGAL-4.11 \ auxiliary \ gmp \ lib” to environment variable “Path”. Move to the environment variable setting screen in the same way as before, and click Edit for Path. When you click New, the input field blinks, so add the above two environment variables to it. ※ Do not delete variables that already exist! !

Test building

Configuration

Create new → Project → win32 Console application

※ Make an empty project. Not precompiled

alt_text

From the project settings , add to the include directory . Add to library directory . Add to the dependent library directory . These make it possible to refer to and execute all functions without intellisense errors.

C:\local\CGAL\auxiliary\gmp\include
C:\local\boost_1_64_0
C:\local\CGAL\build\include
C:\local\CGAL\include
C:\local\CGAL\auxiliary\gmp\lib
C:\local\boost_1_64_0\libs
C:\local\CGAL\build\lib
libgmp-10.lib
libmpfr-4.lib
kernel32.lib
user32.lib

CGAL_Core-vc140-mt-gd-4.13.1.lib
CGAL_ImageIO-vc140-mt-gd-4.13.1.lib
CGAL-vc140-mt-gd-4.13.1.lib

alt_text


Youtube video

video link


Google Doc version of this Tutorial

Link


Quick copy and paste

If you haven’t read the content before this, reading the content before is highly recommended
CMake: https://cmake.org/downCQCload/
Qt5: https://download.qt.io/archive/qt/5.9/5.9.1/
Boost: https://sourceforge.net/projects/boost/files/boost-binaries/
CGAL: https://github.com/CGAL/cgal/releases
  • C/C++:
C:\local\CGAL\auxiliary\gmp\include
C:\local\boost_1_64_0
C:\local\CGAL\build\include
C:\local\CGAL\include
  • Linker/General:
C:\local\CGAL\auxiliary\gmp\lib
C:\local\boost_1_64_0\libs
C:\local\CGAL\build\lib
  • Linker/Input:
libgmp-10.lib
libmpfr-4.lib
kernel32.lib
user32.lib
CGAL_Core-vc140-mt-gd-4.13.1.lib
CGAL_ImageIO-vc140-mt-gd-4.13.1.lib
CGAL-vc140-mt-gd-4.13.1.lib
Avatar
Chengkun (Charlie) Li
MSc student in Robotics
comments powered by Disqus
Next
Previous