From 49dea30a11569c0a304e051c12173d9067be6a58 Mon Sep 17 00:00:00 2001 From: Tim Niklas Uhl Date: Fri, 10 Jan 2025 10:56:28 +0100 Subject: [PATCH] Fix CGAL support for CGAL version 6+ (#56) CGAL defines proper CMake targets since v5, and the previous way of including CGAL from CMake was removed with v6. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cea56b..1d9bd48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,8 +171,12 @@ if (KAGEN_USE_CGAL) set(CGAL_DONT_OVERRIDE_CMAKE_FLAGS TRUE CACHE BOOL "Force CGAL to maintain CMAKE flags") find_package(CGAL QUIET) if (CGAL_FOUND) - add_definitions(-DKAGEN_CGAL_FOUND) + add_definitions(-DKAGEN_CGAL_FOUND) + if (${CGAL_VERSION} VERSION_GREATER_EQUAL 5) + list(APPEND KAGEN_LINK_LIBRARIES CGAL::CGAL) + else() include(${CGAL_USE_FILE}) + endif() else () message(STATUS "Could not find the CGAL library: Random Delaunay Graphs will not be available") endif ()