[pcl] Fix build issues, refresh patches (#37785)

Ported from  #37651.
Fix include dir in pc files.
Fix #37655.
This commit is contained in:
Kai Pastor 2024-03-28 21:21:54 +01:00 committed by GitHub
parent 30822b6c4c
commit fbc542fd5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 246 additions and 128 deletions

View File

@ -1,25 +0,0 @@
diff --git a/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp b/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
index 2e2be0de3..d1340a93c 100644
--- a/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
+++ b/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
@@ -44,7 +44,7 @@ namespace pcl {
namespace detail {
//// Downloads only the neccssary cluster indices from the device to the host.
-void
+PCL_EXPORTS void
economical_download(const pcl::gpu::NeighborIndices& source_indices,
const pcl::Indices& buffer_indices,
std::size_t buffer_size,
diff --git a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
index b427e76d9..7958f80e6 100644
--- a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
+++ b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
@@ -38,5 +38,6 @@
#pragma once
#include <vtkRenderWindowInteractor.h>
+#include <pcl/pcl_exports.h>
-vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();
+PCL_EXPORTS vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();

View File

@ -0,0 +1,85 @@
diff --git a/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp b/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
index 2e2be0de375..1f4e28535c8 100644
--- a/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
+++ b/gpu/segmentation/include/pcl/gpu/segmentation/impl/gpu_extract_clusters.hpp
@@ -39,12 +39,13 @@
#pragma once
#include <pcl/common/copy_point.h>
#include <pcl/gpu/segmentation/gpu_extract_clusters.h>
+#include <pcl/pcl_exports.h>
namespace pcl {
namespace detail {
//// Downloads only the neccssary cluster indices from the device to the host.
-void
+PCL_EXPORTS void
economical_download(const pcl::gpu::NeighborIndices& source_indices,
const pcl::Indices& buffer_indices,
std::size_t buffer_size,
diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_cone.h b/sample_consensus/include/pcl/sample_consensus/sac_model_cone.h
index 6137c26126c..9bf22810650 100644
--- a/sample_consensus/include/pcl/sample_consensus/sac_model_cone.h
+++ b/sample_consensus/include/pcl/sample_consensus/sac_model_cone.h
@@ -41,11 +41,12 @@
#include <pcl/sample_consensus/sac_model.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/common/distances.h>
+#include <pcl/pcl_exports.h>
namespace pcl
{
namespace internal {
- int optimizeModelCoefficientsCone (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
+ PCL_EXPORTS int optimizeModelCoefficientsCone (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
} // namespace internal
/** \brief @b SampleConsensusModelCone defines a model for 3D cone segmentation.
diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_cylinder.h b/sample_consensus/include/pcl/sample_consensus/sac_model_cylinder.h
index 95a6e80873b..12a42ea5a41 100644
--- a/sample_consensus/include/pcl/sample_consensus/sac_model_cylinder.h
+++ b/sample_consensus/include/pcl/sample_consensus/sac_model_cylinder.h
@@ -43,11 +43,12 @@
#include <pcl/sample_consensus/sac_model.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/common/distances.h>
+#include <pcl/pcl_exports.h>
namespace pcl
{
namespace internal {
- int optimizeModelCoefficientsCylinder (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
+ PCL_EXPORTS int optimizeModelCoefficientsCylinder (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
} // namespace internal
/** \brief @b SampleConsensusModelCylinder defines a model for 3D cylinder segmentation.
diff --git a/sample_consensus/include/pcl/sample_consensus/sac_model_sphere.h b/sample_consensus/include/pcl/sample_consensus/sac_model_sphere.h
index 537fcb3d0dd..c3209e3f672 100644
--- a/sample_consensus/include/pcl/sample_consensus/sac_model_sphere.h
+++ b/sample_consensus/include/pcl/sample_consensus/sac_model_sphere.h
@@ -49,11 +49,12 @@
#include <pcl/sample_consensus/sac_model.h>
#include <pcl/sample_consensus/model_types.h>
+#include <pcl/pcl_exports.h>
namespace pcl
{
namespace internal {
- int optimizeModelCoefficientsSphere (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
+ PCL_EXPORTS int optimizeModelCoefficientsSphere (Eigen::VectorXf& coeff, const Eigen::ArrayXf& pts_x, const Eigen::ArrayXf& pts_y, const Eigen::ArrayXf& pts_z);
} // namespace internal
/** \brief SampleConsensusModelSphere defines a model for 3D sphere segmentation.
diff --git a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
index b427e76d9d3..7958f80e616 100644
--- a/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
+++ b/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.h
@@ -38,5 +38,6 @@
#pragma once
#include <vtkRenderWindowInteractor.h>
+#include <pcl/pcl_exports.h>
-vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();
+PCL_EXPORTS vtkRenderWindowInteractor* vtkRenderWindowInteractorFixNew ();

View File

@ -0,0 +1,15 @@
diff --git a/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp
index 2ef5fc27b16..5143080b6de 100644
--- a/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp
+++ b/segmentation/include/pcl/segmentation/impl/grabcut_segmentation.hpp
@@ -48,8 +48,8 @@ namespace pcl
{
template <>
-float squaredEuclideanDistance (const pcl::segmentation::grabcut::Color &c1,
- const pcl::segmentation::grabcut::Color &c2)
+inline float squaredEuclideanDistance (const pcl::segmentation::grabcut::Color &c1,
+ const pcl::segmentation::grabcut::Color &c2)
{
return ((c1.r-c2.r)*(c1.r-c2.r)+(c1.g-c2.g)*(c1.g-c2.g)+(c1.b-c2.b)*(c1.b-c2.b));
}

View File

@ -0,0 +1,70 @@
diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in
index cf21c44..1463514 100644
--- a/PCLConfig.cmake.in
+++ b/PCLConfig.cmake.in
@@ -403,7 +403,7 @@ endif()
find_package(PkgConfig QUIET)
file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR)
-if(WIN32 AND NOT MINGW)
+if(0)
# PCLConfig.cmake is installed to PCL_ROOT/cmake
get_filename_component(PCL_ROOT "${PCL_DIR}" PATH)
if(EXISTS "${PCL_ROOT}/3rdParty")
@@ -425,6 +425,10 @@ elseif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h")
# pcl_message("Found a PCL installation")
set(PCL_CONF_INCLUDE_DIR "${PCL_ROOT}/include")
set(PCL_LIBRARY_DIRS "${PCL_ROOT}/lib")
+ list(APPEND PCL_LIBRARY_DIRS "${PCL_ROOT}/debug/lib")
+ if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$")
+ list(REVERSE PCL_LIBRARY_DIRS)
+ endif()
elseif(EXISTS "${PCL_DIR}/include/pcl/pcl_config.h")
# Found PCLConfig.cmake in a build tree of PCL
# pcl_message("PCL found into a build tree.")
diff --git a/cmake/Modules/FindFLANN.cmake b/cmake/Modules/FindFLANN.cmake
index f42bca3..faca969 100644
--- a/cmake/Modules/FindFLANN.cmake
+++ b/cmake/Modules/FindFLANN.cmake
@@ -85,7 +85,7 @@ if(flann_FOUND)
# Determine FLANN installation root based on the path to the processed Config file
get_filename_component(_config_dir "${flann_CONFIG}" DIRECTORY)
- get_filename_component(FLANN_ROOT "${_config_dir}/../../.." ABSOLUTE)
+ get_filename_component(FLANN_ROOT "${_config_dir}/../.." ABSOLUTE)
unset(_config_dir)
message(STATUS "Found flann version ${flann_VERSION}")
return()
diff --git a/cmake/pcl_utils.cmake b/cmake/pcl_utils.cmake
index d87d02d..9c0ede1 100644
--- a/cmake/pcl_utils.cmake
+++ b/cmake/pcl_utils.cmake
@@ -100,6 +100,7 @@ macro(SET_INSTALL_DIRS)
else()
set(INCLUDE_INSTALL_ROOT "include") # Android, don't put into subdir
endif()
+ set(INCLUDE_INSTALL_ROOT "include")
set(INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT}/pcl")
set(DOC_INSTALL_DIR "share/doc/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
set(BIN_INSTALL_DIR "bin")
@@ -109,6 +110,7 @@ macro(SET_INSTALL_DIRS)
else()
set(PCLCONFIG_INSTALL_DIR "share/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
endif()
+ set(PCLCONFIG_INSTALL_DIR "share/pcl")
endmacro()
diff --git a/cmake/pkgconfig.cmake.in b/cmake/pkgconfig.cmake.in
index c351e44..b10577a 100644
--- a/cmake/pkgconfig.cmake.in
+++ b/cmake/pkgconfig.cmake.in
@@ -3,7 +3,7 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/@LIB_INSTALL_DIR@
#includedir=${prefix}/@INCLUDE_INSTALL_DIR@
-includedir=${prefix}/include/@PROJECT_NAME_LOWER@-@PCL_VERSION_MAJOR@.@PCL_VERSION_MINOR@
+includedir=${prefix}/@INCLUDE_INSTALL_DIR@
Name: @PKG_NAME@
Description: @PKG_DESC@
Version: @PCL_VERSION@

60
ports/pcl/io_ply.patch Normal file
View File

@ -0,0 +1,60 @@
diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in
index cf21c44..4076775 100644
--- a/PCLConfig.cmake.in
+++ b/PCLConfig.cmake.in
@@ -460,6 +460,11 @@ list(LENGTH pcl_all_components PCL_NB_COMPONENTS)
@PCLCONFIG_OPTIONAL_DEPENDENCIES@
+# io_ply subcomponent
+list(APPEND pcl_io_int_dep io_ply)
+set(pcl_io_ply_int_dep common)
+set(pcl_io_ply_ext_dep boost)
+
# VTK components required by PCL
set(PCL_VTK_COMPONENTS "@PCL_VTK_COMPONENTS@")
@@ -517,18 +522,21 @@ foreach(component ${PCL_TO_FIND_COMPONENTS})
string(REGEX REPLACE "^cuda_(.*)$" "\\1" cuda_component "${component}")
string(REGEX REPLACE "^gpu_(.*)$" "\\1" gpu_component "${component}")
+ string(REGEX REPLACE "^io_(.*)$" "\\1" io_component "${component}")
find_path(PCL_${COMPONENT}_INCLUDE_DIR
NAMES pcl/${component}
pcl/apps/${component}
pcl/cuda/${cuda_component} pcl/cuda/${component}
pcl/gpu/${gpu_component} pcl/gpu/${component}
+ pcl/io/${io_component}
HINTS ${PCL_INCLUDE_DIRS}
PATH_SUFFIXES
${component}/include
apps/${component}/include
cuda/${cuda_component}/include
gpu/${gpu_component}/include
+ io/${io_component}/include
DOC "path to ${component} headers"
NO_DEFAULT_PATH)
mark_as_advanced(PCL_${COMPONENT}_INCLUDE_DIR)
diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt
index 7fc86b2..7a39033 100644
--- a/io/CMakeLists.txt
+++ b/io/CMakeLists.txt
@@ -213,6 +213,8 @@ PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/ply" ${PLY_INCLUDES})
target_include_directories(pcl_io_ply PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(pcl_io_ply pcl_common Boost::boost)
+PCL_MAKE_PKGCONFIG(pcl_io_ply COMPONENT ${SUBSYS_NAME} DESC "${SUBSYS_DESC}, PLY" PCL_DEPS common)
+
set(srcs
src/debayer.cpp
src/pcd_grabber.cpp
@@ -432,7 +434,7 @@ if(WITH_ENSENSO)
list(APPEND EXT_DEPS ensenso)
endif()
-PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${EXT_DEPS})
+PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${EXT_DEPS} pcl_io_ply)
# Install include files
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}" ${incs})

View File

@ -1,13 +0,0 @@
diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in
index 4137ed1..167fde2 100644
--- a/PCLConfig.cmake.in
+++ b/PCLConfig.cmake.in
@@ -225,7 +225,7 @@ macro(find_flann)
if(PCL_ALL_IN_ONE_INSTALLER)
set(FLANN_ROOT "${PCL_ROOT}/3rdParty/Flann")
elseif(NOT FLANN_ROOT)
- set(FLANN_ROOT "@FLANN_ROOT@")
+ set(FLANN_ROOT "${VCPKG_IMPORT_PREFIX}")
endif()
set(PCL_FLANN_REQUIRED_TYPE @PCL_FLANN_REQUIRED_TYPE@)

View File

@ -1,43 +0,0 @@
From 2f4952e1767ad5b0349a03ee56d676d226102381 Mon Sep 17 00:00:00 2001
From: raahilsha-z <raahil.sha@zimaging.io>
Date: Wed, 7 Jul 2021 15:59:12 -0400
Subject: [PATCH] pcl_config
---
PCLConfig.cmake.in | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in
index a1283a810..4137ed18c 100644
--- a/PCLConfig.cmake.in
+++ b/PCLConfig.cmake.in
@@ -384,6 +384,7 @@ file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR)
if(WIN32 AND NOT MINGW)
# PCLConfig.cmake is installed to PCL_ROOT/cmake
get_filename_component(PCL_ROOT "${PCL_DIR}" PATH)
+ get_filename_component(PCL_ROOT "${PCL_ROOT}" PATH)
if(EXISTS "${PCL_ROOT}/3rdParty")
set(PCL_ALL_IN_ONE_INSTALLER ON)
endif()
@@ -393,16 +394,9 @@ else()
endif()
# check whether PCLConfig.cmake is found into a PCL installation or in a build tree
-if(EXISTS "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}/pcl/pcl_config.h")
- # Found a PCL installation
- # pcl_message("Found a PCL installation")
- set(PCL_CONF_INCLUDE_DIR "${PCL_ROOT}/include/pcl-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
- set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@")
-elseif(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h")
- # Found a non-standard (likely ANDROID) PCL installation
- # pcl_message("Found a PCL installation")
+if(EXISTS "${PCL_ROOT}/include/pcl/pcl_config.h")
set(PCL_CONF_INCLUDE_DIR "${PCL_ROOT}/include")
- set(PCL_LIBRARY_DIRS "${PCL_ROOT}/lib")
+ set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@" "${PCL_ROOT}/debug/@LIB_INSTALL_DIR@")
elseif(EXISTS "${PCL_DIR}/include/pcl/pcl_config.h")
# Found PCLConfig.cmake in a build tree of PCL
# pcl_message("PCL found into a build tree.")
--
2.32.0.windows.1

View File

@ -1,40 +0,0 @@
From 6f4e2fea829b5986863403d6a611c52c5ac8b2a9 Mon Sep 17 00:00:00 2001
From: raahilsha-z <raahil.sha@zimaging.io>
Date: Wed, 7 Jul 2021 16:00:30 -0400
Subject: [PATCH] pcl_utils
---
cmake/pcl_utils.cmake | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/cmake/pcl_utils.cmake b/cmake/pcl_utils.cmake
index d87d02da9..7c951bfd5 100644
--- a/cmake/pcl_utils.cmake
+++ b/cmake/pcl_utils.cmake
@@ -94,21 +94,12 @@ macro(SET_INSTALL_DIRS)
if(NOT DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR "lib")
endif()
- if(NOT ANDROID)
- set(INCLUDE_INSTALL_ROOT
- "include/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
- else()
- set(INCLUDE_INSTALL_ROOT "include") # Android, don't put into subdir
- endif()
+ set(INCLUDE_INSTALL_ROOT "include")
set(INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_ROOT}/pcl")
set(DOC_INSTALL_DIR "share/doc/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
set(BIN_INSTALL_DIR "bin")
set(PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig")
- if(WIN32 AND NOT MINGW)
- set(PCLCONFIG_INSTALL_DIR "cmake")
- else()
- set(PCLCONFIG_INSTALL_DIR "share/${PROJECT_NAME_LOWER}-${PCL_VERSION_MAJOR}.${PCL_VERSION_MINOR}")
- endif()
+ set(PCLCONFIG_INSTALL_DIR "share/pcl")
endmacro()
--
2.32.0.windows.1

View File

@ -8,13 +8,13 @@ vcpkg_from_github(
add-gcc-version-check.patch
fix-check-sse.patch
fix-numeric-literals-flag.patch
pcl_config.patch
pcl_utils.patch
install-layout.patch
install-examples.patch
no-absolute.patch
fix-clang-cl.patch
fix-pcl-exports.patch
fix-kinfu.patch
gh-5926-exports.patch
gh-5947-kinfu.patch
gh-5985-inline.patch
io_ply.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PCL_SHARED_LIBS)
@ -73,6 +73,10 @@ vcpkg_cmake_configure(
PCL_BUILD_WITH_QHULL_DYNAMIC_LINKING_WIN32
)
if(NOT EXISTS "${CURRENT_INSTALLED_DIR}/lib/pkgconfig/vtk.pc")
file(REMOVE "${CURRENT_PACKAGE_DIR}/lib/pkgconfig/pcl_gpu_kinfu_large_scale.pc" "${CURRENT_PACKAGE_DIR}/debug/lib/pkgconfig/pcl_gpu_kinfu_large_scale.pc")
endif()
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()

View File

@ -1,7 +1,7 @@
{
"name": "pcl",
"version": "1.14.0",
"port-version": 2,
"port-version": 3,
"description": "Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing.",
"homepage": "https://github.com/PointCloudLibrary/pcl",
"license": "BSD-3-Clause",

View File

@ -6666,7 +6666,7 @@
},
"pcl": {
"baseline": "1.14.0",
"port-version": 2
"port-version": 3
},
"pcre": {
"baseline": "8.45",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9776a87fc76d599003ab1341bfb8f9a84bbb9f84",
"version": "1.14.0",
"port-version": 3
},
{
"git-tree": "21bdd0f28179266f7d337a3503457bba19a7546f",
"version": "1.14.0",