CGAL 计算几何算法库
CGAL 提供了丰富的计算几何方面的算法, 这里存放了一些安 装使用 CGAL 的基本信息。
sudo apt install qt-default
sudo apt install libqt5svg5-dev
仓库
git clone https://github.com/CGAL/cgal.git
安装
从 CGAL 5.0 开始, CGAL 默认只安装头文件, 如果需要编译 CGAL 的动态库, 需要显式 修改默认的行为:
cd $HOME/CGAL-5.0.2
mkdir build
cd build
cmake -DCGAL_HEADER_ONLY=OFF -DCMAKE_BUILD_TYPE=Release  ..   # configure CGAL
make                                                          # build CGAL
make install                                                  # install CGAL
下在是编译 example 的命令:
cd examples/Triangulation_2                                                       # go to an example directory
cmake -DCGAL_DIR=$CMAKE_INSTALLED_PREFIX/lib/CGAL -DCMAKE_BUILD_TYPE=Release .    # configure the examples
make
如果要指定安装目录, 可以用下面的 cmake 变量指定:
-DCMAKE_INSTALL_PREFIX=~/.local
问题及解决方案
Qt5
Configuring libCGAL_Qt5
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake:27 (message):
  The imported target "Qt5::Gui" references the file
     "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqwayland-generic.so"
  but this file does not exist.  Possible reasons include:
  * The file was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and contained
     "/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5Gui_QWaylandIntegrationPlugin.cmake"
  but not all the files it references.
解决方法:
sudo apt install qtwayland5