【发布时间】:2019-06-18 12:19:07
【问题描述】:
我已经跑了:
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。
【问题讨论】:
-
你还需要安装更多的 Qt5 包 (libqt5svg5-dev?)。是的,也许它们可以作为 libcgal-qt5-dev 的依赖项(或至少是建议)添加......它们确实显示为 libcgal-demo 的建议。
-
谢谢你让我运行似乎
cmake但make失败:/app/test_cgal.cpp:4:10:致命错误:CGAL/draw_surface_mesh.h:没有这样的文件或目录#include。我只是想从以下位置编译示例:github.com/CGAL/cgal/wiki/… -
这个例子取自CGAL 4.12,但是在Ubuntu的包管理器中,只有CGAL 4.11。如果要使用 draw_...() 函数,至少需要 4.12。例如,您可以从 github 获取它,无需构建,它只是标题。