From: ccee5db79d6037c4d752b5f29dc30fb0dfd039bf Mon Sep 17 00:00:00 2001
From: Timothée Couble <timothee.couble@kitware.com>
From: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10692
Date: Fri, 10 Nov 2023 10:03:07 +0100
Subject: [PATCH 1/2] IOPDAL: Always links with pdalcpp

pdal_base and pdal_utils libraries are removed in PDAL 2.6.0
link with pdalcpp instead starting from this version.
--- a/IO/PDAL/CMakeLists.txt
+++ b/IO/PDAL/CMakeLists.txt
@@ -3,14 +3,20 @@ vtk_module_find_package(PACKAGE PDAL VERSION 2.1)
 set(classes
   vtkPDALReader)
 
-set(pdal_libraries pdal_util)
-if (APPLE OR WIN32)
+set(pdal_libraries)
+if (PDAL_VERSION VERSION_LESS "2.6")
+  set(pdal_libraries pdal_util)
+  if (APPLE OR WIN32)
+    list(APPEND pdal_libraries
+      pdalcpp)
+  else()
+    list(APPEND pdal_libraries
+      pdal_base)
+  endif()
+else ()
   list(APPEND pdal_libraries
     pdalcpp)
-else()
-  list(APPEND pdal_libraries
-    pdal_base)
-endif()
+endif ()
 
 vtk_module_add_module(VTK::IOPDAL
   CLASSES ${classes})
-- 
GitLab


From 5bf45b44760bac09b0079827346e78af38d981af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Couble?= <timothee.couble@kitware.com>
Date: Fri, 10 Nov 2023 10:12:32 +0100
Subject: [PATCH 2/2] Add support for PDAL 2.0 version

--- a/IO/PDAL/CMakeLists.txt
+++ b/IO/PDAL/CMakeLists.txt
@@ -23,4 +23,13 @@ vtk_module_add_module(VTK::IOPDAL
 vtk_module_link(VTK::IOPDAL
   PRIVATE
     ${pdal_libraries})
+
+# PDAL 2.0 didn't include interfaces to its exported targets.
+# Resolved in https://github.com/PDAL/PDAL/issues/2262.
+if (PDAL_VERSION VERSION_LESS "2.1")
+  vtk_module_include(VTK::IOPDAL
+    PRIVATE
+      ${PDAL_INCLUDE_DIRS})
+endif ()
+
 vtk_add_test_mangling(VTK::IOPDAL)
-- 
GitLab

