6

I have run:

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

But when I try and compile a simple CGAL program with cmake using:

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()

I get this error:

-- 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)

I don't understanding why it's complaining about QT5 when I've installed libcgal-qt5-dev.

nickponline
  • 25,354
  • 32
  • 99
  • 167
  • You still need to install more Qt5 packages (libqt5svg5-dev?). Yes, maybe they could be added as dependencies (or at least recommendations) for libcgal-qt5-dev... They do appear as suggestions for libcgal-demo. – Marc Glisse Jan 24 '19 at 18:54
  • Thank you that allowed me to run seem `cmake` but `make` fails with: /app/test_cgal.cpp:4:10: fatal error: CGAL/draw_surface_mesh.h: No such file or directory #include . I'm just trying to compile the example from: https://github.com/CGAL/cgal/wiki/How-to-use-CGAL-with-CMake-or-your-own-build-system – nickponline Jan 24 '19 at 23:50
  • This example is taken from CGAL 4.12, but in the package manager of Ubuntu, it is only CGAL 4.11. If you want to use the draw_...() functions, you need at least 4.12. You can get it from github for example, no need to build, it is header-only. – mgimeno Jan 25 '19 at 08:56

1 Answers1

3

I needed apt-get install libqt5svg5-dev

nickponline
  • 25,354
  • 32
  • 99
  • 167