sci-libs/pdal: fix fetch issue

Closes: https://bugs.gentoo.org/961431
Signed-off-by: Thomas Bettler <thomas.bettler@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/43434
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
This commit is contained in:
Thomas Bettler
2025-08-13 19:50:34 +02:00
committed by Eli Schwartz
parent ed2fb79ff1
commit 49401b9432
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
From https://github.com/PDAL/PDAL/commit/6e3d5ed48205dcef884243db6585f7da4631604c Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
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()

View File

@@ -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