如何在Ubuntu 18:04上使用QT5安装CGAL?

时间:2019-01-24 17:17:29

标签: qt cgal

我已经跑步:

apt-get install -y libcgal-ipelets libcgal-dev libcgal-qt5-dev libcgal-demo

但是当我尝试使用cmake使用以下命令编译一个简单的CGAL程序时:

cmake_minimum_required(VERSION 3.1)
project(test_cgal)
#CGAL_Qt5 is needed for the drawing and CGAL_Core is needed for this special Kernel.
find_package(CGAL REQUIRED COMPONENTS Qt5 Core)
if(CGAL_FOUND AND CGAL_Qt5_FOUND)
  #required to use basic_viewer
  add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
  #create the executable of the application
  add_executable(test_ test_cgal.cpp)
  #link it with the required CGAL libraries
  target_link_libraries(test_ CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core)
else()
  message("ERROR: this program requires CGAL and CGAL_Qt5 and will not be compiled.")
endif()

我收到此错误:

-- libCGAL_Qt5 is missing the dependencies:  Qt5Svg Qt5 cannot be configured.
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGALConfig.cmake:137 (message):
  ERROR: The CGAL_Qt5 library was not configured.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGALConfig.cmake:147 (check_cgal_component)
  CMakeLists.txt:43 (find_package)

我不明白为什么安装libcgal-qt5-dev后为什么抱怨QT5。

1 个答案:

答案 0 :(得分:0)

我需要apt-get install libqt5svg5-dev