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
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
Then start the installation process
Then we wait for the installation to complete
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
.
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.
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
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.
C:\local\CGAL-4.11
Configuration
Let Source code be and Build the binaries be. Press Configure.
C:/local/CGAL-4.11
C:/local/CGAL-4.11/build
Here, select Visual studio 15 2017 Win64 and click Finish.
t turns red, but it is not an error because it is DONE. Click Generate.
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.
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
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
Youtube video
Google Doc version of this Tutorial
Quick copy and paste
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