diff --git a/recipes/pcl/all/conandata.yml b/recipes/pcl/all/conandata.yml new file mode 100644 index 00000000000000..bd83c7f169bf95 --- /dev/null +++ b/recipes/pcl/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "1.13.1": + url: https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.13.1.tar.gz + sha256: 8ab98a9db371d822de0859084a375a74bdc7f31c96d674147710cf4101b79621 +patches: + "1.13.1": + - patch_file: "patches/0001-test.patch" + patch_description: "Update pcl CMake files to work with conan" + patch_type: "conan" + - patch_file: "patches/0001-KB-H020_avoid_pkgconfig_files.patch" + patch_description: "Disable pkgconfig files install to follow KB-H020 rule" + patch_type: "conan" + - patch_file: "patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch" + patch_description: "Report fix from https://github.com/PointCloudLibrary/pcl/pull/5764" + patch_type: "conan" + - patch_file: "patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch" + patch_description: "Report fix from https://github.com/PointCloudLibrary/pcl/pull/5764" + patch_type: "conan" diff --git a/recipes/pcl/all/conanfile.py b/recipes/pcl/all/conanfile.py new file mode 100644 index 00000000000000..9f740fe5b9a4ad --- /dev/null +++ b/recipes/pcl/all/conanfile.py @@ -0,0 +1,240 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.microsoft import check_min_vs, is_msvc +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir +from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.system import package_manager +import os + + +required_conan_version = ">=1.53.0" + + +class PclConan(ConanFile): + name = "pcl" + description = "Point Cloud Library" + license = "BSD-3-Clause" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/PointCloudLibrary/pcl" + topics = ("computer vision", "point cloud", "pointcloud", "3d", "pcd", "ply", "stl", "ifs", "vtk") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openmp": [True, False], + "with_libusb": [True, False], + "with_png": [True, False], + "with_qhull": [True, False], + "with_vtk": [True, False], + "with_cuda": [True, False], + "with_pcap": [True, False], + "with_opengl": [True, False], + "with_tools": [True, False], + "with_apps": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openmp": False, + "with_libusb": False, + "with_png": True, + "with_qhull": True, + "with_vtk": False, + "with_cuda": False, + "with_pcap": False, + "with_opengl": False, + "with_tools": False, + "with_apps": False, + } + + @property + def _min_cppstd(self): + return 17 + + # in case the project requires C++14/17/20/... the minimum compiler version should be listed + @property + def _compilers_minimum_version(self): + return { + "gcc": "7", + "clang": "7", + "apple-clang": "10", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def system_requirements(self): + if self.options.with_vtk: + package_manager.Apt(self).install(["libvtk-dev"]) + package_manager.Dnf(self).install(["vtk-devel"]) + if self.settings.os == "Windows": + self.output.warn("On Windows VTK must be installed manually.") + + def requirements(self): + self.requires("zlib/1.2.13") + # Transitive headers on boost because pcl/point_struct_traits.h:40:10: references boost/mpl/assert.hpp + self.requires("boost/1.82.0", transitive_headers=True) + self.requires("eigen/3.4.0", transitive_headers=True) + self.requires("flann/1.9.2") + if self.options.with_png: + self.requires("libpng/1.6.40") + if self.options.with_qhull: + self.requires("qhull/8.0.1") + if self.options.with_apps: + self.requires("qt/6.5.1") + if self.options.with_libusb: + self.requires("libusb/1.0.26") + if self.options.with_pcap: + self.requires("libpcap/1.10.4") + if self.options.with_opengl: + self.requires("opengl/system") + + def validate(self): + # validate the minimum cpp standard supported. For C++ projects only + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + check_min_vs(self, 191) + if not is_msvc(self): + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["PCL_SHARED_LIBS"] = self.options.shared + tc.variables["WITH_OPENMP"] = self.options.with_openmp + tc.variables["WITH_LIBUSB"] = self.options.with_libusb + tc.variables["WITH_PNG"] = self.options.with_png + tc.variables["WITH_QHULL"] = self.options.with_qhull + tc.variables["WITH_VTK"] = self.options.with_vtk + tc.variables["WITH_CUDA"] = self.options.with_cuda + tc.variables["WITH_PCAP"] = self.options.with_pcap + tc.variables["WITH_OPENGL"] = self.options.with_opengl + tc.variables["BUILD_tools"] = self.options.with_tools + tc.variables["BUILD_apps"] = self.options.with_apps + tc.variables["BUILD_examples"] = True + tc.cache_variables["WITH_QT"] = self.options.with_apps + tc.generate() + + tc = CMakeDeps(self) + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure(variables={"PCL_ONLY_CORE_POINT_TYPES": "ON"}) + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.txt", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + + rmdir(self, os.path.join(self.package_folder, "share")) + + @property + def _pcl_lib_components(self): + def usb(): + return ["libusb::libusb"] if self.options.with_libusb else [] + def png(): + return ["libpng::libpng"] if self.options.with_png else [] + def qhull(): + return ["qhull::qhull"] if self.options.with_qhull else [] + + return { + "common": {"requires": ["eigen::eigen3", "boost::boost"]}, + "kdtree": {"requires": ["common", "flann::flann"]}, + "octree": {"requires": ["common"]}, + "search": {"requires": ["common", "kdtree", "octree", "flann::flann"]}, + "sample_consensus": {"requires": ["common", "search"]}, + "filters": {"requires": ["common", "sample_consensus", "search", "kdtree", "octree"]}, + "2d": {"requires": ["common", "filters"], "header_only": True}, + "geometry": {"requires": ["common"], "header_only": True}, + "io": {"requires": ["common", "octree", "zlib::zlib"] + png() + usb(), "extra_libs": ["io_ply"]}, + "features": {"requires": ["common", "search", "kdtree", "octree", "filters", "2d"]}, + "ml": {"requires": ["common"]}, + "segmentation": {"requires": ["common", "geometry", "search", "sample_consensus", "kdtree", "octree", "features", "filters", "ml"]}, + "surface": {"requires": ["common", "search", "kdtree", "octree"] + qhull()}, + "registration": {"requires": ["common", "octree", "kdtree", "search", "sample_consensus", "features", "filters"]}, + "keypoints": {"requires": ["common", "search", "kdtree", "octree", "features", "filters"]}, + "tracking": {"requires": ["common", "search", "kdtree", "filters", "octree"]}, + "recognition": {"requires": ["common", "io", "search", "kdtree", "octree", "features", "filters", "registration", "sample_consensus", "ml"]}, + "stereo": {"requires": ["common", "io"]} + } + + @property + def _version_suffix(self): + semver = Version(self.version) + return "{}.{}".format(semver.major, semver.minor) + + def _lib_name(self, lib): + if self.settings.compiler == "msvc" and self.settings.build_type == "Debug": + return "pcl_{}d".format(lib) + return "pcl_{}".format(lib) + + def package_info(self): + self.cpp_info.names["cmake_find_package"] = "PCL" + self.cpp_info.names["cmake_find_package_multi"] = "PCL" + + self.cpp_info.set_property("cmake_file_name", "PCL") + self.cpp_info.set_property("cmake_module_file_name", "PCL") + self.cpp_info.set_property("cmake_target_name", "PCL::PCL") + + def _update_components(components): + for comp, values in components.items(): + self.cpp_info.components[comp].names["cmake_find_package"] = comp + self.cpp_info.components[comp].names["cmake_find_package_multi"] = comp + self.cpp_info.components[comp].set_property("cmake_file_name", comp) + self.cpp_info.components[comp].set_property("cmake_module_file_name", comp) + self.cpp_info.components[comp].set_property("cmake_target_name", f"PCL::{comp}") + + self.cpp_info.components[comp].names["pkg_config"] = "pcl_{}-{}".format(comp, self._version_suffix) + self.cpp_info.components[comp].set_property("pkg_config_name", "pcl_{}-{}".format(comp, self._version_suffix)) + + self.cpp_info.components[comp].includedirs = [os.path.join("include", "pcl-{}".format(self._version_suffix))] + if not values.get("header_only", False): + libs = [comp] + values.get("extra_libs", []) + self.cpp_info.components[comp].libs = [self._lib_name(lib) for lib in libs] + self.cpp_info.components[comp].requires = values["requires"] + + _update_components(self._pcl_lib_components) + + if not self.options.shared: + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["common"].system_libs.append("pthread") + if self.options.with_openmp: + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + self.cpp_info.components["common"].sharedlinkflags.append("-fopenmp") + self.cpp_info.components["common"].exelinkflags.append("-fopenmp") + elif self.settings.os == "Windows": + if self.settings.compiler == "msvc": + self.cpp_info.components["common"].system_libs.append("delayimp") + elif self.settings.compiler == "gcc": + self.cpp_info.components["common"].system_libs.append("gomp") + + if self.options.with_apps: + self.cpp_info.components["apps"].libs = [] + self.cpp_info.components["apps"].requires = ["qt::qt"] diff --git a/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch b/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch new file mode 100644 index 00000000000000..5dfeedf59e5f46 --- /dev/null +++ b/recipes/pcl/all/patches/0001-Add-Eigen3-Eigen-target-in-pcl_common-target.patch @@ -0,0 +1,25 @@ +From a975f68d2e399a1563fe0d66b2c048978f0282d1 Mon Sep 17 00:00:00 2001 +From: Esteban DUGUEPEROUX +Date: Mon, 7 Aug 2023 23:50:12 +0200 +Subject: [PATCH] Add Eigen3::Eigen target in pcl_common target + +--- + common/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt +index 48e1a202e..e0ced5241 100644 +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -179,7 +179,7 @@ target_include_directories(${LIB_NAME} PUBLIC + $ + ) + +-target_link_libraries(${LIB_NAME} Boost::boost) ++target_link_libraries(${LIB_NAME} Boost::boost Eigen3::Eigen) + + if(MSVC AND NOT (MSVC_VERSION LESS 1915)) + # MSVC resolved a byte alignment issue in compiler version 15.9 +-- +2.41.0 + diff --git a/recipes/pcl/all/patches/0001-KB-H020_avoid_pkgconfig_files.patch b/recipes/pcl/all/patches/0001-KB-H020_avoid_pkgconfig_files.patch new file mode 100644 index 00000000000000..4397cd3de043a3 --- /dev/null +++ b/recipes/pcl/all/patches/0001-KB-H020_avoid_pkgconfig_files.patch @@ -0,0 +1,12 @@ +--- a/cmake/pcl_targets.cmake ++++ b/cmake/pcl_targets.cmake +@@ -571,9 +571,6 @@ function(PCL_MAKE_PKGCONFIG _name) + else() + configure_file(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake.in ${_pc_file} @ONLY) + endif() +- install(FILES ${_pc_file} +- DESTINATION ${PKGCFG_INSTALL_DIR} +- COMPONENT pcl_${ARGS_COMPONENT}) + endfunction() + + ############################################################################### diff --git a/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch b/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch new file mode 100644 index 00000000000000..fe10ff7c3f6c47 --- /dev/null +++ b/recipes/pcl/all/patches/0001-ReportFixAboutMemoryConsumptionDuringBuild.patch @@ -0,0 +1,19 @@ +--- a/surface/src/mls.cpp ++++ b/surface/src/mls.cpp +@@ -80,6 +80,15 @@ pcl::MLSResult::calculatePrincipalCurvatures (const double u, const double v) co + PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal)) + ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) + #else +- PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, (PCL_XYZ_POINT_TYPES)(PCL_XYZ_POINT_TYPES)) ++ // PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, (PCL_XYZ_POINT_TYPES)(PCL_XYZ_POINT_TYPES)) ++ // All instantiations that are available with PCL_ONLY_CORE_POINT_TYPES, plus instantiations for all XYZ types where PointInT and PointOutT are the same ++ #define PCL_INSTANTIATE_MovingLeastSquaresSameInAndOut(T) template class PCL_EXPORTS pcl::MovingLeastSquares; ++ PCL_INSTANTIATE(MovingLeastSquaresSameInAndOut, PCL_XYZ_POINT_TYPES) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZ))((pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZI))((pcl::PointXYZ)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGB))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGBA))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointXYZRGBNormal))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointNormal))) ++ PCL_INSTANTIATE_PRODUCT(MovingLeastSquares, ((pcl::PointNormal))((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGB)(pcl::PointXYZRGBA)(pcl::PointXYZRGBNormal))) + #endif + #endif // PCL_NO_PRECOMPILE diff --git a/recipes/pcl/all/patches/0001-test.patch b/recipes/pcl/all/patches/0001-test.patch new file mode 100644 index 00000000000000..230d3dd37c3aba --- /dev/null +++ b/recipes/pcl/all/patches/0001-test.patch @@ -0,0 +1,217 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,7 +31,7 @@ if(MSVC AND ("${MSVC_VERSION}" LESS 1910)) + endif() + + ### ---[ Find universal dependencies +-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH}) ++# set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH}) + + # ---[ Include pkgconfig + include(FindPkgConfig) +@@ -319,11 +319,13 @@ endif() + find_package(Threads REQUIRED) + + # Eigen (required) +-find_package(Eigen 3.3 REQUIRED) ++find_package(Eigen3 REQUIRED) ++string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_CMAKE_BUILD_TYPE) ++set(EIGEN_INCLUDE_DIRS ${eigen_INCLUDE_DIRS_${UPPER_CMAKE_BUILD_TYPE}}) + include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) + + # FLANN (required) +-find_package(FLANN 1.9.1 REQUIRED) ++find_package(flann 1.9.1 REQUIRED) + if(NOT (${FLANN_LIBRARY_TYPE} MATCHES ${PCL_FLANN_REQUIRED_TYPE}) AND NOT (${PCL_FLANN_REQUIRED_TYPE} MATCHES "DONTCARE")) + message(FATAL_ERROR "Flann was selected with ${PCL_FLANN_REQUIRED_TYPE} but found as ${FLANN_LIBRARY_TYPE}") + endif() +--- a/PCLConfig.cmake.in ++++ b/PCLConfig.cmake.in +@@ -670,8 +670,8 @@ pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES) + + # Add 3rd party libraries, as user code might include our .HPP implementations + list(APPEND PCL_LIBRARIES ${PCL_BOOST_LIBRARIES} ${PCL_OPENNI_LIBRARIES} ${PCL_OPENNI2_LIBRARIES} ${PCL_ENSENSO_LIBRARIES} ${PCL_davidSDK_LIBRARIES} ${PCL_DSSDK_LIBRARIES} ${PCL_RSSDK_LIBRARIES} ${PCL_RSSDK2_LIBRARIES} ${PCL_VTK_LIBRARIES}) +-if (TARGET FLANN::FLANN) +- list(APPEND PCL_LIBRARIES FLANN::FLANN) ++if (TARGET flann::flann) ++ list(APPEND PCL_LIBRARIES flann::flann) + endif() + + if(TARGET QHULL::QHULL) +--- a/apps/3d_rec_framework/CMakeLists.txt ++++ b/apps/3d_rec_framework/CMakeLists.txt +@@ -98,7 +98,7 @@ endif() + + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSUBSYS_NAME} DESC ${SUBSUBSYS_DESC}) + +-if(QHULL_FOUND) ++if(Qhull_FOUND) + add_executable(pcl_global_classification src/tools/global_classification.cpp) + target_link_libraries(pcl_global_classification pcl_apps pcl_3d_rec_framework pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_surface) + endif() +--- a/apps/CMakeLists.txt ++++ b/apps/CMakeLists.txt +@@ -61,7 +61,7 @@ if(VTK_FOUND) + PCL_ADD_EXECUTABLE(pcl_pcd_organized_multi_plane_segmentation COMPONENT ${SUBSYS_NAME} SOURCES src/pcd_organized_multi_plane_segmentation.cpp) + target_link_libraries(pcl_pcd_organized_multi_plane_segmentation pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_features) + +- if(QHULL_FOUND) ++ if(Qhull_FOUND) + PCL_ADD_EXECUTABLE(pcl_pcd_select_object_plane COMPONENT ${SUBSYS_NAME} SOURCES src/pcd_select_object_plane.cpp) + target_link_libraries(pcl_pcd_select_object_plane pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_features pcl_surface) + endif() +@@ -185,7 +185,7 @@ if(VTK_FOUND) + + endif() + +- if(QHULL_FOUND) ++ if(Qhull_FOUND) + PCL_ADD_EXECUTABLE(pcl_openni_3d_convex_hull COMPONENT ${SUBSYS_NAME} SOURCES src/openni_3d_convex_hull.cpp BUNDLE) + target_link_libraries(pcl_openni_3d_convex_hull pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_features pcl_surface) + +@@ -200,7 +200,7 @@ if(VTK_FOUND) + + PCL_ADD_EXECUTABLE(pcl_ni_linemod COMPONENT ${SUBSYS_NAME} SOURCES src/ni_linemod.cpp BUNDLE) + target_link_libraries(pcl_ni_linemod pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_features pcl_surface pcl_search) +- endif() # QHULL_FOUND ++ endif() # Qhull_FOUND + + PCL_ADD_EXECUTABLE(pcl_ni_agast COMPONENT ${SUBSYS_NAME} SOURCES src/ni_agast.cpp BUNDLE) + target_link_libraries(pcl_ni_agast pcl_common pcl_io pcl_filters pcl_visualization pcl_segmentation pcl_sample_consensus pcl_features pcl_keypoints pcl_surface pcl_search) +@@ -241,7 +241,7 @@ foreach(subdir ${PCL_APPS_MODULES_DIRS}) + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/${subdir}") + endforeach() + +-if(QHULL_FOUND) ++if(Qhull_FOUND) + set(incs + "include/pcl/${SUBSYS_NAME}/dominant_plane_segmentation.h" + "include/pcl/${SUBSYS_NAME}/timer.h" +--- a/cmake/pcl_targets.cmake ++++ b/cmake/pcl_targets.cmake +@@ -126,7 +126,8 @@ macro(PCL_SUBSYS_DEPEND _var) + endif() + if(ARGS_EXT_DEPS) + foreach(_dep ${ARGS_EXT_DEPS}) +- string(TOUPPER "${_dep}_found" EXT_DEP_FOUND) ++ set(EXT_DEP_FOUND "${_dep}_FOUND") ++ message(STATUS "EXT_DEP_FOUND: ${EXT_DEP_FOUND}") + #Variable EXT_DEP_FOUND expands to ie. QHULL_FOUND which in turn is then used to see if the EXT_DEPS is found. + if(NOT ${EXT_DEP_FOUND}) + set(${_var} FALSE) +--- a/common/CMakeLists.txt ++++ b/common/CMakeLists.txt +@@ -4,7 +4,7 @@ set(SUBSYS_DEPS) + + set(build TRUE) + PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) +-PCL_SUBSYS_DEPEND(build NAME ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS} EXT_DEPS eigen boost) ++PCL_SUBSYS_DEPEND(build NAME ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS} EXT_DEPS Eigen3 Boost) + + PCL_ADD_DOC("${SUBSYS_NAME}") + +--- a/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt ++++ b/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt +@@ -16,7 +16,7 @@ include_directories(SYSTEM + + add_executable(build_tree build_tree.cpp) + target_link_libraries(build_tree ${PCL_LIBRARIES} ${Boost_LIBRARIES} +- FLANN::FLANN ${HDF5_LIBRARIES}) ++ flann::flann ${HDF5_LIBRARIES}) + + add_executable(nearest_neighbors nearest_neighbors.cpp) +-target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} ${Boost_LIBRARIES} FLANN::FLANN ${HDF5_LIBRARIES}) ++target_link_libraries(nearest_neighbors ${PCL_LIBRARIES} ${Boost_LIBRARIES} flann::flann ${HDF5_LIBRARIES}) +--- a/io/CMakeLists.txt ++++ b/io/CMakeLists.txt +@@ -1,7 +1,7 @@ + set(SUBSYS_NAME io) + set(SUBSYS_DESC "Point cloud IO library") + set(SUBSYS_DEPS common octree) +-set(SUBSYS_EXT_DEPS boost eigen) ++set(SUBSYS_EXT_DEPS Boost Eigen3) + + set(build TRUE) + PCL_SUBSYS_OPTION(build "${SUBSYS_NAME}" "${SUBSYS_DESC}" ON) +--- a/kdtree/CMakeLists.txt ++++ b/kdtree/CMakeLists.txt +@@ -30,7 +30,7 @@ set(impl_incs + set(LIB_NAME "pcl_${SUBSYS_NAME}") + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") + PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) +-target_link_libraries("${LIB_NAME}" pcl_common FLANN::FLANN) ++target_link_libraries("${LIB_NAME}" pcl_common flann::flann) + set(EXT_DEPS flann) + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${EXT_DEPS}) + +--- a/search/CMakeLists.txt ++++ b/search/CMakeLists.txt +@@ -41,7 +41,7 @@ set(impl_incs + set(LIB_NAME "pcl_${SUBSYS_NAME}") + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") + PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${impl_incs}) +-target_link_libraries("${LIB_NAME}" pcl_common FLANN::FLANN pcl_octree pcl_kdtree) ++target_link_libraries("${LIB_NAME}" pcl_common flann::flann pcl_octree pcl_kdtree) + list(APPEND EXT_DEPS flann) + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) + +--- a/surface/CMakeLists.txt ++++ b/surface/CMakeLists.txt +@@ -12,7 +12,7 @@ if(NOT build) + return() + endif() + +-if(QHULL_FOUND) ++if(Qhull_FOUND) + set(HULL_INCLUDES + "include/pcl/${SUBSYS_NAME}/concave_hull.h" + "include/pcl/${SUBSYS_NAME}/convex_hull.h" +@@ -192,8 +192,12 @@ if(VTK_FOUND) + endif() + endif() + +-if(QHULL_FOUND) +- target_link_libraries("${LIB_NAME}" QHULL::QHULL) ++if(Qhull_FOUND) ++ if(TARGET Qhull::qhull_r) ++ target_link_libraries("${LIB_NAME}" Qhull::qhull_r) ++ else() ++ target_link_libraries("${LIB_NAME}" Qhull::qhullstatic_r) ++ endif() + endif() + + PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) +--- a/test/features/CMakeLists.txt ++++ b/test/features/CMakeLists.txt +@@ -91,7 +91,7 @@ if(BUILD_io) + ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") + PCL_ADD_TEST(features_narf test_narf + FILES test_narf.cpp +- LINK_WITH pcl_gtest pcl_features FLANN::FLANN) ++ LINK_WITH pcl_gtest pcl_features flann::flann) + PCL_ADD_TEST(a_ii_normals_test test_ii_normals + FILES test_ii_normals.cpp + LINK_WITH pcl_gtest pcl_io pcl_features +--- a/test/surface/CMakeLists.txt ++++ b/test/surface/CMakeLists.txt +@@ -41,7 +41,7 @@ PCL_ADD_TEST(surface_poisson test_poisson + LINK_WITH pcl_gtest pcl_io pcl_kdtree pcl_surface pcl_features + ARGUMENTS "${PCL_SOURCE_DIR}/test/bun0.pcd") + +-if(QHULL_FOUND) ++if(Qhull_FOUND) + PCL_ADD_TEST(surface_convex_hull test_convex_hull + FILES test_convex_hull.cpp + LINK_WITH pcl_gtest pcl_io pcl_kdtree pcl_surface pcl_features pcl_filters pcl_search +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -272,7 +272,7 @@ if(TARGET pcl_surface) + PCL_ADD_EXECUTABLE(pcl_poisson_reconstruction COMPONENT ${SUBSYS_NAME} SOURCES poisson_reconstruction.cpp) + target_link_libraries(pcl_poisson_reconstruction pcl_common pcl_io pcl_surface) + +- if(QHULL_FOUND) ++ if(Qhull_FOUND) + PCL_ADD_EXECUTABLE(pcl_crop_to_hull COMPONENT ${SUBSYS_NAME} SOURCES crop_to_hull.cpp) + target_link_libraries(pcl_crop_to_hull pcl_common pcl_io pcl_filters pcl_surface) + + diff --git a/recipes/pcl/all/test_package/CMakeLists.txt b/recipes/pcl/all/test_package/CMakeLists.txt new file mode 100644 index 00000000000000..57794a612df2a9 --- /dev/null +++ b/recipes/pcl/all/test_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.15) + +project(test_package CXX) + +find_package(PCL REQUIRED surface CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp) + +target_link_libraries(${PROJECT_NAME} PRIVATE PCL::filters) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/pcl/all/test_package/conanfile.py b/recipes/pcl/all/test_package/conanfile.py new file mode 100644 index 00000000000000..02eb5ce439fb40 --- /dev/null +++ b/recipes/pcl/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +# It will become the standard on Conan 2.x +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/pcl/all/test_package/test_package.cpp b/recipes/pcl/all/test_package/test_package.cpp new file mode 100644 index 00000000000000..cca717d08eb8f6 --- /dev/null +++ b/recipes/pcl/all/test_package/test_package.cpp @@ -0,0 +1,73 @@ +// Copied from https://github.com/PointCloudLibrary/pcl/blob/pcl-1.13.1/examples/filters/example_extract_indices.cpp +/* + * Software License Agreement (BSD License) + * + * Point Cloud Library (PCL) - www.pointclouds.org + * Copyright (c) 2009-2011, Willow Garage, Inc. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $Id: example_ExtractIndices.cpp 4117 2012-01-31 17:56:02Z aichim $ + * + */ + +#include + +#include + +int +main (int, char**) +{ + using PointType = pcl::PointXYZ; + using CloudType = pcl::PointCloud; + CloudType::Ptr cloud (new CloudType); + cloud->is_dense = false; + PointType p; + for (unsigned int i = 0; i < 5; ++i) + { + p.x = p.y = p.z = static_cast (i); + cloud->push_back (p); + } + + std::cout << "Cloud has " << cloud->size () << " points." << std::endl; + + pcl::PointIndices indices; + indices.indices.push_back (0); + indices.indices.push_back (2); + + pcl::ExtractIndices extract_indices; + extract_indices.setIndices (pcl::make_shared (indices)); + extract_indices.setInputCloud (cloud); + pcl::PointCloud::Ptr output (new pcl::PointCloud); + extract_indices.filter (*output); + + std::cout << "Output has " << output->size () << " points." << std::endl; + return (0); +} diff --git a/recipes/pcl/config.yml b/recipes/pcl/config.yml new file mode 100644 index 00000000000000..aac1819cc10c01 --- /dev/null +++ b/recipes/pcl/config.yml @@ -0,0 +1,3 @@ +versions: + "1.13.1": + folder: all