diff options
author | 2024-08-23 20:38:24 +0200 | |
---|---|---|
committer | 2024-08-25 16:40:32 +0100 | |
commit | f5cdd67d42ee05752c649a7c7225f8841cb71213 (patch) | |
tree | 7d9e7337184f07809054152150f496cf6f59e97e /sci-libs | |
parent | sci-libs/pcl: Fix compilation on GCC 15 (diff) | |
download | gentoo-f5cdd67d42ee05752c649a7c7225f8841cb71213.tar.gz gentoo-f5cdd67d42ee05752c649a7c7225f8841cb71213.tar.bz2 gentoo-f5cdd67d42ee05752c649a7c7225f8841cb71213.zip |
sci-libs/pcl: enable tests
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38269
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/pcl/files/pcl-1.14.1-tests.patch | 26 | ||||
-rw-r--r-- | sci-libs/pcl/pcl-1.14.1.ebuild | 16 | ||||
-rw-r--r-- | sci-libs/pcl/pcl-9999.ebuild | 16 |
3 files changed, 48 insertions, 10 deletions
diff --git a/sci-libs/pcl/files/pcl-1.14.1-tests.patch b/sci-libs/pcl/files/pcl-1.14.1-tests.patch new file mode 100644 index 000000000000..83919b0c0c07 --- /dev/null +++ b/sci-libs/pcl/files/pcl-1.14.1-tests.patch @@ -0,0 +1,26 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> +Date: Thu, 22 Aug 2024 17:40:21 +0200 +Subject: [PATCH] enable tests + +Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,11 +8,12 @@ if(NOT build) + return() + endif() + +-find_package(GTestSource REQUIRED) +-include_directories(SYSTEM ${GTEST_INCLUDE_DIRS} ${GTEST_SRC_DIR}) +- +-add_library(pcl_gtest STATIC ${GTEST_SRC_DIR}/src/gtest-all.cc) +-target_include_directories(pcl_gtest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) ++find_package(GTest REQUIRED) ++add_library(pcl_gtest INTERFACE IMPORTED) ++set_target_properties(pcl_gtest PROPERTIES ++ INTERFACE_LINK_LIBRARIES GTest::gtest ++ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/include ++) + + enable_testing() + + diff --git a/sci-libs/pcl/pcl-1.14.1.ebuild b/sci-libs/pcl/pcl-1.14.1.ebuild index a9c716c2e295..b5d59362af57 100644 --- a/sci-libs/pcl/pcl-1.14.1.ebuild +++ b/sci-libs/pcl/pcl-1.14.1.ebuild @@ -14,13 +14,12 @@ else S="${WORKDIR}/${PN}-${P}" fi -HOMEPAGE="https://pointclouds.org/" DESCRIPTION="2D/3D image and point cloud processing" +HOMEPAGE="https://pointclouds.org/" LICENSE="BSD" SLOT="0/$(ver_cut 1-2)" IUSE="cuda doc opengl openni openni2 pcap png +qhull qt5 qt6 usb vtk cpu_flags_x86_sse test tutorials" -# tests need the gtest sources to be available at build time -RESTRICT="test" +RESTRICT="!test? ( test )" RDEPEND=" >=sci-libs/flann-1.7.1 @@ -51,6 +50,7 @@ RDEPEND=" " DEPEND="${RDEPEND} !!dev-cpp/metslib + test? ( dev-cpp/gtest ) " BDEPEND=" doc? ( @@ -62,7 +62,8 @@ BDEPEND=" dev-python/sphinx-rtd-theme dev-python/sphinxcontrib-doxylink ) - virtual/pkgconfig" + virtual/pkgconfig +" REQUIRED_USE=" openni? ( usb ) @@ -74,6 +75,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.12.1-allow-configuration-of-install-dirs.patch "${FILESDIR}"/${PN}-1.12.1-fix-hardcoded-relative-directory-of-the-installed-cmake-files.patch "${FILESDIR}/${PN}-1.14.1-gcc15.patch" + "${FILESDIR}/${PN}-1.14.1-tests.patch" ) src_prepare() { @@ -102,7 +104,7 @@ src_configure() { "-DPCL_ENABLE_SSE=$(usex cpu_flags_x86_sse TRUE FALSE)" "-DWITH_DOCS=$(usex doc TRUE FALSE)" "-DWITH_TUTORIALS=$(usex tutorials TRUE FALSE)" - "-DBUILD_global_tests=FALSE" + -DBUILD_global_tests="$(usex test)" ) if use qt5; then @@ -115,3 +117,7 @@ src_configure() { cmake_src_configure } + +src_test() { + BUILD_DIR="${BUILD_DIR}/test" cmake_src_test +} diff --git a/sci-libs/pcl/pcl-9999.ebuild b/sci-libs/pcl/pcl-9999.ebuild index a9c716c2e295..b5d59362af57 100644 --- a/sci-libs/pcl/pcl-9999.ebuild +++ b/sci-libs/pcl/pcl-9999.ebuild @@ -14,13 +14,12 @@ else S="${WORKDIR}/${PN}-${P}" fi -HOMEPAGE="https://pointclouds.org/" DESCRIPTION="2D/3D image and point cloud processing" +HOMEPAGE="https://pointclouds.org/" LICENSE="BSD" SLOT="0/$(ver_cut 1-2)" IUSE="cuda doc opengl openni openni2 pcap png +qhull qt5 qt6 usb vtk cpu_flags_x86_sse test tutorials" -# tests need the gtest sources to be available at build time -RESTRICT="test" +RESTRICT="!test? ( test )" RDEPEND=" >=sci-libs/flann-1.7.1 @@ -51,6 +50,7 @@ RDEPEND=" " DEPEND="${RDEPEND} !!dev-cpp/metslib + test? ( dev-cpp/gtest ) " BDEPEND=" doc? ( @@ -62,7 +62,8 @@ BDEPEND=" dev-python/sphinx-rtd-theme dev-python/sphinxcontrib-doxylink ) - virtual/pkgconfig" + virtual/pkgconfig +" REQUIRED_USE=" openni? ( usb ) @@ -74,6 +75,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.12.1-allow-configuration-of-install-dirs.patch "${FILESDIR}"/${PN}-1.12.1-fix-hardcoded-relative-directory-of-the-installed-cmake-files.patch "${FILESDIR}/${PN}-1.14.1-gcc15.patch" + "${FILESDIR}/${PN}-1.14.1-tests.patch" ) src_prepare() { @@ -102,7 +104,7 @@ src_configure() { "-DPCL_ENABLE_SSE=$(usex cpu_flags_x86_sse TRUE FALSE)" "-DWITH_DOCS=$(usex doc TRUE FALSE)" "-DWITH_TUTORIALS=$(usex tutorials TRUE FALSE)" - "-DBUILD_global_tests=FALSE" + -DBUILD_global_tests="$(usex test)" ) if use qt5; then @@ -115,3 +117,7 @@ src_configure() { cmake_src_configure } + +src_test() { + BUILD_DIR="${BUILD_DIR}/test" cmake_src_test +} |