diff --git a/sci-libs/pdal/files/pdal-2.9.0-fix-build-without-gtest.patch b/sci-libs/pdal/files/pdal-2.9.0-fix-build-without-gtest.patch new file mode 100644 index 0000000000000..29e7e17a466a5 --- /dev/null +++ b/sci-libs/pdal/files/pdal-2.9.0-fix-build-without-gtest.patch @@ -0,0 +1,23 @@ +From https://github.com/PDAL/PDAL/commit/6e3d5ed48205dcef884243db6585f7da4631604c Mon Sep 17 00:00:00 2001 +From: Aleix Pol +Date: Thu, 26 Jun 2025 13:28:17 +0200 +Subject: [PATCH] Fix build without googletest when WITH_TESTS=OFF (#4753) + +Don't pull the library if we are not going to use it. +--- + cmake/macros.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/macros.cmake b/cmake/macros.cmake +index 25fe690930..645c77e1c2 100644 +--- a/cmake/macros.cmake ++++ b/cmake/macros.cmake +@@ -185,7 +185,7 @@ endmacro(PDAL_ADD_PLUGIN) + # INCLUDES header file directories + # + # If we don't have GTest go activate it first +-if(NOT TARGET GTest::gtest) ++if(WITH_TESTS AND NOT TARGET GTest::gtest) + include (${PDAL_CMAKE_DIR}/gtest.cmake) + endif() + diff --git a/sci-libs/pdal/pdal-2.9.0-r1.ebuild b/sci-libs/pdal/pdal-2.9.0-r1.ebuild index b850249d42794..cc81ffde391bb 100644 --- a/sci-libs/pdal/pdal-2.9.0-r1.ebuild +++ b/sci-libs/pdal/pdal-2.9.0-r1.ebuild @@ -18,6 +18,7 @@ IUSE="debug postgres test" BDEPEND=" sys-devel/gettext virtual/pkgconfig + test? ( >=dev-cpp/gtest-1.15.0 ) " RDEPEND=" net-misc/curl @@ -40,6 +41,7 @@ RESTRICT="!test? ( test )" PATCHES=( "${FILESDIR}"/${P}-fix-includes.patch + "${FILESDIR}"/${P}-fix-build-without-gtest.patch ) src_configure() { @@ -47,6 +49,7 @@ src_configure() { -DBUILD_PLUGIN_PGPOINTCLOUD="$(usex postgres)" -DWITH_COMPLETION=ON -DWITH_BACKTRACE="$(usex debug)" + -DWITH_TESTS="$(usex test)" ) cmake_src_configure