Fix build issue with CGAL 6.0
authorSebastien Loriot <sebastien.loriot@cgal.org>
Mon, 30 Dec 2024 18:21:18 +0000 (19:21 +0100)
committerDrew Parsons <dparsons@debian.org>
Mon, 30 Dec 2024 18:21:18 +0000 (19:21 +0100)
Origin, upstream: https://github.com/meshpro/pygalmesh/pull/214
Bug-Debian: https://bugs.debian.org/1074381
Last-Update: 2024-11-16

Origin, upstream: https://github.com/meshpro/pygalmesh/pull/214
Bug-Debian: https://bugs.debian.org/1074381
Last-Update: 2024-11-16

Gbp-Pq: Name build-with-CGAL-6.0.patch

src/CMakeLists.txt
src/generate.cpp
src/generate_from_inr.cpp
src/generate_from_off.cpp

index d2145889db176d0a7771d12444a7d712222f5bff..fbd597dd8d2d6e86a3a36043e5178dc6f12a685d 100644 (file)
@@ -5,7 +5,6 @@ FIND_PACKAGE(Eigen3 REQUIRED)
 include_directories(${EIGEN3_INCLUDE_DIR})
 
 FIND_PACKAGE(CGAL REQUIRED)
-include(${CGAL_USE_FILE})
 
 FILE(GLOB pygalmesh_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
 # FILE(GLOB pygalmesh_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
@@ -13,7 +12,7 @@ FILE(GLOB pygalmesh_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
 pybind11_add_module(pygalmesh ${pygalmesh_SRCS})
 
 # ADD_LIBRARY(pygalmesh ${pygalmesh_SRCS})
-target_link_libraries(pygalmesh PRIVATE ${CGAL_LIBRARIES})
+target_link_libraries(pygalmesh PRIVATE CGAL::CGAL)
 
 # https://github.com/CGAL/cgal/issues/6002
 # find_program(iwyu_path NAMES include-what-you-use iwyu REQUIRED)
index 64b0ba51eecf4e902738fbfe751cad9bc7634f18..baef05207008c79df960e7b5a41c7a43190b5f01 100644 (file)
@@ -8,7 +8,7 @@
 #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
 #include <CGAL/Mesh_criteria_3.h>
 
-#include <CGAL/Implicit_mesh_domain_3.h>
+#include <CGAL/Labeled_mesh_domain_3.h>
 #include <CGAL/Mesh_domain_with_polyline_features_3.h>
 #include <CGAL/make_mesh_3.h>
 
index 1d63fe6b21454e4d4d367469a5d519cedf230334..a01e4c92c924eb7e94d0e6a59d619175a63e7fc2 100644 (file)
@@ -11,7 +11,7 @@
 #include <CGAL/Mesh_complex_3_in_triangulation_3.h>
 #include <CGAL/Mesh_criteria_3.h>
 
-#include <CGAL/Implicit_mesh_domain_3.h>
+#include <CGAL/Labeled_mesh_domain_3.h>
 #include <CGAL/Mesh_domain_with_polyline_features_3.h>
 #include <CGAL/make_mesh_3.h>
 
index fcebef502121adb0f1c82353a86e811923ef4fbe..c0a1abfa34d0f38de6a30a2225765c9fc33f4c72 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <CGAL/version_macros.h>
 
-#if CGAL_VERSION_MAJOR >= 5 && CGAL_VERSION_MINOR < 3
+#if (CGAL_VERSION_MAJOR == 5 && CGAL_VERSION_MINOR < 3)
   #include <CGAL/IO/OFF_reader.h>
 #endif
 
@@ -78,7 +78,7 @@ void generate_from_off(
 
     if(
       !input ||
-#if CGAL_VERSION_MAJOR >= 5 && CGAL_VERSION_MINOR >= 3
+#if (CGAL_VERSION_MAJOR >= 5 && CGAL_VERSION_MINOR >= 3) || (CGAL_VERSION_MAJOR >= 6)
       !CGAL::IO::read_OFF(input, points, polygons) ||
 #else
       !CGAL::read_OFF(input, points, polygons) ||