0

I want to make a script that uses the CGAL Library having it installed only using the .deb package. (Using: sudo apt-get install libcgal-dev).

I get the following error message when I run this command : cmake -S . -B build/ -DCMAKE_BUILD_TYPE= Release .

enter image description here

I am on an ubuntu 20.04 machine with the following versions:

  • g++ 9.4.0
  • cmake 3.16

My CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 3.16)

project(integration)

find_package(CGAL)

if ( CGAL_FOUND )

message("CGAL Found !")

endif ( CGAL_FOUND )

add_executable(${PROJECT_NAME} extract_segmentation_into_mesh_example.cpp)

target_link_libraries(${PROJECT_NAME} CGAL::CGAL)

I'm also able to find the directory CGAL in /usr/include/.

alpha027
  • 302
  • 2
  • 13
  • 2
    CGAL doesn't provide a FindCGAL.cmake. ```pkg_check_modules``` might work. – Jonathan S. May 04 '22 at 11:47
  • 1
    In principle, it should be detected automatically but you can try setting CGAL_DIR to `/usr/lib/x86_64-linux-gnu/cmake/CGAL` (`CGALConfig.cmake` should be in that directory). Try `dpkg -L libcgal-dev | grep Config` to be sure. – sloriot May 04 '22 at 13:09
  • Interesting, the command `dpkg -L libcgal-dev | grep Config` returns the CGALConfing.cmake path, but when I do `cd /usr/lib/x86_64-linux-gnu/cmake/CGAL` I get `cd: /usr/lib/x86_64-linux-gnu/cmake/CGAL: No such file or directory`. I uninstalled libcgal-dev and installed it again the problem was solved, the directory was there. (got other compilation errors but the cmake problem is solved ) – alpha027 May 04 '22 at 14:49

0 Answers0