Skip to content

Commit

Permalink
Copy pcl port mods into this repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjansen committed Nov 8, 2024
1 parent d09d0d7 commit 13d2743
Show file tree
Hide file tree
Showing 13 changed files with 583 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 2105 files
27 changes: 27 additions & 0 deletions vcpkg-additions/ports/pcl/add-gcc-version-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 116e665df611242ea0575a62478c31ec03e78fcc Mon Sep 17 00:00:00 2001
From: raahilsha-z <[email protected]>
Date: Wed, 7 Jul 2021 15:53:49 -0400
Subject: [PATCH] add gcc version check

---
CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63b38df68..29f79d31b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,6 +311,10 @@ if(NOT (${FLANN_LIBRARY_TYPE} MATCHES ${PCL_FLANN_REQUIRED_TYPE}) AND NOT (${PCL
endif()
endif()

+if(UNIX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
+ set (CMAKE_CXX_STANDARD 17)
+endif()
+
# libusb
option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE)
if(WITH_LIBUSB)
--
2.32.0.windows.1

25 changes: 25 additions & 0 deletions vcpkg-additions/ports/pcl/fix-check-sse.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From c65e034afb538932f4ff55a93332f875ae43a578 Mon Sep 17 00:00:00 2001
From: raahilsha-z <[email protected]>
Date: Wed, 7 Jul 2021 15:54:33 -0400
Subject: [PATCH] fix check sse

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29f79d31b..a1d9bb58f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -86,7 +86,7 @@ endif()

# check for SSE flags
include("${PCL_SOURCE_DIR}/cmake/pcl_find_sse.cmake")
-if(PCL_ENABLE_SSE AND "${CMAKE_CXX_FLAGS}" STREQUAL "${CMAKE_CXX_FLAGS_DEFAULT}")
+if(PCL_ENABLE_SSE)
PCL_CHECK_FOR_SSE()
endif()

--
2.32.0.windows.1

26 changes: 26 additions & 0 deletions vcpkg-additions/ports/pcl/fix-clang-cl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/common/include/pcl/impl/instantiate.hpp b/common/include/pcl/impl/instantiate.hpp
index ea73a0c..4cfc92b 100644
--- a/common/include/pcl/impl/instantiate.hpp
+++ b/common/include/pcl/impl/instantiate.hpp
@@ -95,7 +95,7 @@
//
// ((x)(y)(z))((1)(2)(3))((dracula)(radu))
//
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && ! defined(__clang__)
#define PCL_INSTANTIATE_PRODUCT_IMPL(r, product) \
BOOST_PP_CAT(PCL_INSTANTIATE_, BOOST_PP_SEQ_HEAD(product)) \
BOOST_PP_EXPAND(BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fad95c9..b4ca305 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
# Compiler identification
# Define a variable CMAKE_COMPILER_IS_X where X is the compiler short name.
# Note: CMake automatically defines one for GNUCXX, nothing to do in this case.
-if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT MSVC)
set(CMAKE_COMPILER_IS_CLANG 1)
elseif(__COMPILER_PATHSCALE)
set(CMAKE_COMPILER_IS_PATHSCALE 1)
26 changes: 26 additions & 0 deletions vcpkg-additions/ports/pcl/fix-numeric-literals-flag.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 3ea8aa5ded2782cfb10577348fc9f56144c72d7b Mon Sep 17 00:00:00 2001
From: raahilsha-z <[email protected]>
Date: Wed, 7 Jul 2021 15:57:46 -0400
Subject: [PATCH] fix numeric literals flag

---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7cf86f74b..e07fd430a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -420,6 +420,9 @@ endif()

# Boost (required)
include("${PCL_SOURCE_DIR}/cmake/pcl_find_boost.cmake")
+if (NOT APPLE AND NOT WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ add_definitions(-fext-numeric-literals)
+endif()

# System zlib (for nurbs on surface)
option(WITH_SYSTEM_ZLIB "Use system zlib" TRUE)
--
2.32.0.windows.1

15 changes: 15 additions & 0 deletions vcpkg-additions/ports/pcl/gh-5985-inline.patch
Original file line number Diff line number Diff line change
@@ -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));
}
13 changes: 13 additions & 0 deletions vcpkg-additions/ports/pcl/install-examples.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cmake/pcl_targets.cmake b/cmake/pcl_targets.cmake
index 91f2404..18f5a24 100644
--- a/cmake/pcl_targets.cmake
+++ b/cmake/pcl_targets.cmake
@@ -473,6 +473,8 @@ macro(PCL_ADD_EXAMPLE _name)
# add target to list of example targets created at the parent scope
list(APPEND PCL_EXAMPLES_ALL_TARGETS ${_name})
set(PCL_EXAMPLES_ALL_TARGETS "${PCL_EXAMPLES_ALL_TARGETS}" PARENT_SCOPE)
+
+ install(TARGETS ${_name} RUNTIME DESTINATION ${BIN_INSTALL_DIR})
endmacro()

###############################################################################
70 changes: 70 additions & 0 deletions vcpkg-additions/ports/pcl/install-layout.patch
Original file line number Diff line number Diff line change
@@ -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 changes: 60 additions & 0 deletions vcpkg-additions/ports/pcl/io_ply.patch
Original file line number Diff line number Diff line change
@@ -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})
PCL_ADD_INCLUDES("${SUBSYS_NAME}" "${SUBSYS_NAME}/ply" ${PLY_INCLUDES})
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})
Loading

0 comments on commit 13d2743

Please sign in to comment.