Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcl] Add feature apps, visualization, simulation, examples and add usage #21788

Merged
merged 8 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only generate these examples in CMAKE_BINARY_DIR is not enough.
They also need the dependency libraries to execute.

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()

###############################################################################
34 changes: 23 additions & 11 deletions ports/pcl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vcpkg_from_github(
fix-cmake_find_library_suffixes.patch
fix-pkgconfig.patch # Remove this patch in the next update
fix-find-libusb.patch
install-examples.patch
)

file(REMOVE "${SOURCE_PATH}/cmake/Modules/FindQhull.cmake"
Expand All @@ -32,16 +33,26 @@ endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
openni2 WITH_OPENNI2
qt WITH_QT
pcap WITH_PCAP
cuda WITH_CUDA
cuda BUILD_CUDA
cuda BUILD_GPU
tools BUILD_tools
opengl WITH_OPENGL
vtk WITH_VTK
libusb WITH_LIBUSB
openni2 WITH_OPENNI2
qt WITH_QT
pcap WITH_PCAP
cuda WITH_CUDA
cuda BUILD_CUDA
cuda BUILD_GPU
tools BUILD_tools
opengl WITH_OPENGL
vtk WITH_VTK
libusb WITH_LIBUSB
visualization BUILD_visualization
examples BUILD_examples
apps BUILD_apps
apps BUILD_apps_cloud_composer
apps BUILD_apps_modeler
apps BUILD_apps_point_cloud_editor
# These 2 apps need openni1
#apps BUILD_apps_in_hand_scanner
#apps BUILD_apps_3d_rec_framework
simulation BUILD_simulation
)

vcpkg_cmake_configure(
Expand Down Expand Up @@ -103,12 +114,13 @@ vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

if("tools" IN_LIST FEATURES)
if(BUILD_tools OR BUILD_apps OR BUILD_examples)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
file(GLOB EXEFILES_RELEASE "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(GLOB EXEFILES_DEBUG "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(COPY ${EXEFILES_RELEASE} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/pcl")
file(REMOVE ${EXEFILES_RELEASE} ${EXEFILES_DEBUG})
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/pcl")
endif()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
4 changes: 4 additions & 0 deletions ports/pcl/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The package pcl provides CMake targets:

find_package(PCL CONFIG REQUIRED)
target_link_libraries(main PRIVATE ${PCL_LIBRARIES})
52 changes: 49 additions & 3 deletions ports/pcl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pcl",
"version": "1.12.0",
"port-version": 1,
"port-version": 2,
"description": "Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing.",
"homepage": "https://github.com/PointCloudLibrary/pcl",
"supports": "!(arm64 & windows)",
Expand Down Expand Up @@ -37,12 +37,33 @@
}
],
"features": {
"apps": {
"description": "Build application examples/samples that show how PCL works",
"dependencies": [
{
"name": "pcl",
"default-features": false,
"features": [
"opengl",
"openni2",
"qt",
"vtk"
]
}
]
},
"cuda": {
"description": "CUDA support for PCL",
"dependencies": [
"cuda"
]
},
"examples": {
"description": "Build PCL examples",
"dependencies": [
"vtk"
]
},
"libusb": {
"description": "Build USB RGBD-Camera drivers",
"dependencies": [
Expand Down Expand Up @@ -90,17 +111,42 @@
}
]
},
"simulation": {
"description": "Build Point Cloud Library Simulation",
"dependencies": [
"glew",
{
"name": "pcl",
"default-features": false,
"features": [
"opengl"
]
}
]
},
"tools": {
"description": "Build PCL utilities",
"dependencies": [
"boost-accumulators"
]
},
"vtk": {
"description": "VTK-Visualizations support for PCL",
"visualization": {
"description": "Build visualization",
"dependencies": [
"vtk"
]
},
"vtk": {
"description": "An alias for visualization",
"dependencies": [
{
"name": "pcl",
"default-features": false,
"features": [
"visualization"
]
}
]
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5170,7 +5170,7 @@
},
"pcl": {
"baseline": "1.12.0",
"port-version": 1
"port-version": 2
},
"pcre": {
"baseline": "8.45",
Expand Down
5 changes: 5 additions & 0 deletions versions/p-/pcl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5d02740fc9422f1b520ae322cda71e8e6e5323cf",
"version": "1.12.0",
"port-version": 2
},
{
"git-tree": "a2eb47fa4d7f959d9c8712f0d0925c2af94bcc80",
"version": "1.12.0",
Expand Down