CGAL Installation Guide:

MSYS2 case.

Posted by Oussama Ennafii on January 4, 2017

Motivation

 In the previous post, I explained how to build CGAL on Windows using MinGW. Using MinGW, I was deploring the lack of a good package manager for Minimalist GNU. Another reason was the fact that I needed QT5 (to build CGAL_QT5 target) that is not suitable for MinGW. Fortunately, there is MSYS2. You can get more details about this project from their wiki. Thus, in this post, I will show how to install MSYS2 and use MinGW w64 to install CGAL.

MSYS2

 I will not cover the history nor the motivations for this projects. You could do so on the team’s official website. Instead, I will address the installation instructions. You need to follow these instructions: they are self-explanatory. If you need to learn more about pacman you can do so on this wiki. Regarding the silent installation, I did not have enough time to understand how it should be done.

CGAL

 CGAL is already available in pacman repositories. It is however not provided with QT5 dependency. If this is enough for your needs then the installation would be a matter of minutes if not seconds:

pacman -Syu pacman # This will update pacman
pacman -S mingw-w64-x86_64-cgal # I recommend to use MinGW w64

 If you prefer otherwise to build CGAL you need to install some tools:

pacman -Syu pacman
pacman -S mingw-w64-x86_64-toolchain # Gets basic development tools
pacman -S mingw-w64-x86_64-{boost,cmake,qt5}

 You need now to download CGAL release-4.9 and build CGAL as follows:

MSYSTEM=MINGW64 . /etc/profile # Or open mingw64.exe instead of msys2.exe

cd "C:\Path\to\CGAL"
mkdir build
cd build

cmake -G"Unix Makefiles" ..
make -j4 all
make -j4 install
make install_FindCGAL