Search code examples
cmakecgal

Using CGAL 5.1 with third party Libraries


I am trying to compile the example read_las_example.cpp in CGAL examples directory Point_set_processing_3.

However cmake command runs into the error:

include could not find load file:

    CGAL_LASLIB_support

There are some directions on using CGAL with third party libraries here : https://doc.cgal.org/latest/Manual/thirdparty.html#thirdpartyLASlib but I am not able to follow it. In particular I don't understand how to do this - "the executables should be linked with the CMake imported target CGAL::LASLIB_support provided in CGAL_LASLIB_support.cmake". If it helps, the CGAL_LASLIB_support.cmake file is located in the directory cgal/5.1/lib/cmake/CGAL

Can anyone help with how to use CGAL with third party libraries, in particular LASlib.


Solution

  • It means you need to include CGAL_LASLIB_support and call target_link_libraries(your_exe_name CGAL::LASLIB_support) It is already used in the example's CmakeLists.txt, you should check that the CGAL you are using is really 5.1, not another version cached somewhere in your system. The target CGAL::LASLIB_support only exists since 5.1, so the error seems to indicate that the CGAL version you are using is not the right one.