From aac3c934eb63fa616b9f0b7eb77fe3da7ea0ac6a Mon Sep 17 00:00:00 2001 From: Ilya Glushchenko Date: Mon, 15 Mar 2021 00:08:56 +0300 Subject: [PATCH] [vcpkg] PCL VTK9 support. --- ports/pcl/CONTROL | 2 +- ports/pcl/add-gcc-version-check.patch | 6 ++-- ports/pcl/fix-link-libpng.patch | 32 ++++++++++------- ports/pcl/portfile.cmake | 7 ++-- ports/pcl/realsense2.patch | 13 ------- ports/pcl/use_flann_targets.patch | 20 +++++------ ports/rtabmap/001_opencv.patch | 50 ++++++++------------------- ports/rtabmap/portfile.cmake | 8 ++--- ports/rtabmap/vcpkg.json | 4 +-- versions/baseline.json | 2 +- versions/p-/pcl.json | 5 +++ versions/r-/rtabmap.json | 5 +++ 12 files changed, 67 insertions(+), 87 deletions(-) delete mode 100644 ports/pcl/realsense2.patch diff --git a/ports/pcl/CONTROL b/ports/pcl/CONTROL index 5954613bb7b37a..194b94a56f1998 100644 --- a/ports/pcl/CONTROL +++ b/ports/pcl/CONTROL @@ -1,6 +1,6 @@ Source: pcl Version: 1.11.1 -Port-Version: 2 +Port-Version: 3 Homepage: https://github.com/PointCloudLibrary/pcl Description: Point Cloud Library (PCL) is open source library for 2D/3D image and point cloud processing. Build-Depends: eigen3, flann, qhull, libpng, boost-system, boost-filesystem, boost-thread, boost-date-time, boost-iostreams, boost-random, boost-foreach, boost-dynamic-bitset, boost-property-map, boost-graph, boost-multi-array, boost-signals2, boost-sort, boost-ptr-container, boost-uuid, boost-interprocess, boost-asio diff --git a/ports/pcl/add-gcc-version-check.patch b/ports/pcl/add-gcc-version-check.patch index dbef34b63fa130..b38a72859f72b7 100644 --- a/ports/pcl/add-gcc-version-check.patch +++ b/ports/pcl/add-gcc-version-check.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6c452ce..2c50b8d 100644 +index 456009cd3..c1998252f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,6 +303,10 @@ set(FLANN_USE_STATIC ON) @@ -7,9 +7,9 @@ index 6c452ce..2c50b8d 100644 find_package(lz4) +if(UNIX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) -+ set (CMAKE_CXX_STANDARD 17) ++ set(CMAKE_CXX_STANDARD 17) +endif() + - # libusb-1.0 + # libusb option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE) if(WITH_LIBUSB) diff --git a/ports/pcl/fix-link-libpng.patch b/ports/pcl/fix-link-libpng.patch index 2d5ea5f3bd3f98..b88062f9ef91ce 100644 --- a/ports/pcl/fix-link-libpng.patch +++ b/ports/pcl/fix-link-libpng.patch @@ -1,20 +1,26 @@ diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt -index f234971..86ea242 100644 +index d26e60421..893104b77 100644 --- a/io/CMakeLists.txt +++ b/io/CMakeLists.txt -@@ -333,12 +333,13 @@ set(LIB_NAME "pcl_${SUBSYS_NAME}") - add_definitions(${VTK_DEFINES}) - PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${compression_incs} ${impl_incs} ${OPENNI_INCLUDES} ${OPENNI2_INCLUDES}) +@@ -334,6 +334,10 @@ PCL_ADD_LIBRARY(${LIB_NAME} COMPONENT ${SUBSYS_NAME} SOURCES ${srcs} ${incs} ${c + target_include_directories(${LIB_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") --link_directories(${VTK_LINK_DIRECTORIES}) --target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES}) - if(PNG_FOUND) - target_link_libraries("${LIB_NAME}" ${PNG_LIBRARIES}) - endif() -+link_directories(${VTK_LINK_DIRECTORIES}) -+target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply ${VTK_LIBRARIES}) ++if(PNG_FOUND) ++ target_link_libraries("${LIB_NAME}" ${PNG_LIBRARIES}) ++endif() + - if(LIBUSB_1_FOUND) - target_link_libraries("${LIB_NAME}" ${LIBUSB_1_LIBRARIES}) + target_link_libraries("${LIB_NAME}" pcl_common pcl_io_ply) + if(VTK_FOUND) + if(${VTK_VERSION} VERSION_LESS 9.0) +@@ -347,10 +351,6 @@ if(VTK_FOUND) + endif() + endif() + +-if(PNG_FOUND) +- target_link_libraries("${LIB_NAME}" ${PNG_LIBRARIES}) +-endif() +- + if(LIBUSB_FOUND) + target_link_libraries("${LIB_NAME}" libusb::libusb) endif() diff --git a/ports/pcl/portfile.cmake b/ports/pcl/portfile.cmake index 92fb2e41b9ec12..4aa8d644cb4b76 100644 --- a/ports/pcl/portfile.cmake +++ b/ports/pcl/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO PointCloudLibrary/pcl - REF d98313133b014553ab1b1b5b112f9aade837d55c # pcl-1.11.1 - SHA512 4d60f34d4fbf0a4b4caf9cc4391af471ebd260b3bbac106d45e5ff38448894ea4dc82d5320c2e395c537a4414eb13c6a6a0eb6c13e4e1cc1d831d4bf24067966 + REF 4d59ab8eeee0ed45865562015450d77c730044ea # pcl-1.11.1+patch + SHA512 d98bed0bbd22df7a12f76fb6c2776912dccfd97938f9d8453c0cadfda0697e05017ca7a7f42ec269732bf24b8f62c4d906f14c028cc2a08cf816f8e545f00dc8 HEAD_REF master PATCHES pcl_utils.patch @@ -12,7 +12,6 @@ vcpkg_from_github( fix-link-libpng.patch remove-broken-targets.patch fix-check-sse.patch - realsense2.patch add-gcc-version-check.patch ) @@ -66,7 +65,7 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -if("tools" IN_LIST FEATURES) +if("tools" IN_LIST FEATURES) file(GLOB EXEFILES_RELEASE ${CURRENT_PACKAGES_DIR}/bin/*.exe) file(GLOB EXEFILES_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(COPY ${EXEFILES_RELEASE} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/pcl) diff --git a/ports/pcl/realsense2.patch b/ports/pcl/realsense2.patch deleted file mode 100644 index cfe2cc41f1b255..00000000000000 --- a/ports/pcl/realsense2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/io/src/real_sense_2_grabber.cpp b/io/src/real_sense_2_grabber.cpp -index d13231e..06d1238 100644 ---- a/io/src/real_sense_2_grabber.cpp -+++ b/io/src/real_sense_2_grabber.cpp -@@ -287,7 +287,7 @@ namespace pcl - cloud->width = sp.width (); - cloud->height = sp.height (); - cloud->is_dense = false; -- cloud->points.resize ( size () ); -+ cloud->points.resize ( points.size () ); - - const auto cloud_vertices_ptr = points.get_vertices (); - const auto cloud_texture_ptr = points.get_texture_coordinates (); diff --git a/ports/pcl/use_flann_targets.patch b/ports/pcl/use_flann_targets.patch index a948cc010c739a..180d4d1364f6e4 100644 --- a/ports/pcl/use_flann_targets.patch +++ b/ports/pcl/use_flann_targets.patch @@ -4,7 +4,7 @@ index 93a6448..b24f681 100644 +++ b/CMakeLists.txt @@ -302,10 +302,9 @@ find_package(Eigen 3.1 REQUIRED) include_directories(SYSTEM ${EIGEN_INCLUDE_DIRS}) - + # FLANN (required) -if(NOT PCL_SHARED_LIBS OR ((WIN32 AND NOT MINGW) AND NOT PCL_BUILD_WITH_FLANN_DYNAMIC_LINKING_WIN32)) - set(FLANN_USE_STATIC ON) @@ -12,15 +12,15 @@ index 93a6448..b24f681 100644 +set(FLANN_USE_STATIC ON) find_package(FLANN 1.7.0 REQUIRED) +find_package(lz4) - - # libusb-1.0 + + # libusb option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE) diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in index 79077fb..042467b 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in @@ -88,11 +88,6 @@ endmacro() - + ### ---[ 3rd party libraries macro(find_boost) - if(PCL_ALL_IN_ONE_INSTALLER) @@ -32,7 +32,7 @@ index 79077fb..042467b 100644 if(WIN32) set(Boost_USE_STATIC_LIBS @Boost_USE_STATIC_LIBS@) @@ -667,8 +662,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 ${BOOST_LIBRARIES} ${QHULL_LIBRARIES} ${OPENNI_LIBRARIES} ${OPENNI2_LIBRARIES} ${ENSENSO_LIBRARIES} ${davidSDK_LIBRARIES} ${DSSDK_LIBRARIES} ${RSSDK_LIBRARIES} ${RSSDK2_LIBRARIES} ${VTK_LIBRARIES}) -if (TARGET FLANN::FLANN) @@ -40,19 +40,19 @@ index 79077fb..042467b 100644 +if (TARGET flann::flann_cpp) + list(APPEND PCL_LIBRARIES flann::flann_cpp) endif() - + find_package_handle_standard_args(PCL DEFAULT_MSG PCL_LIBRARIES PCL_INCLUDE_DIRS) diff --git a/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt b/doc/tutorials/content/sources/vfh_recognition/CMakeLists.txt index 7d25d3f..18227a6 100644 --- 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_cpp ${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_cpp ${HDF5_LIBRARIES}) @@ -68,7 +68,7 @@ index 826e902..f714130 100644 +target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp) set(EXT_DEPS flann) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS} EXT_DEPS ${EXT_DEPS}) - + diff --git a/search/CMakeLists.txt b/search/CMakeLists.txt index 46f4632..67c5e53 100644 --- a/search/CMakeLists.txt @@ -81,7 +81,7 @@ index 46f4632..67c5e53 100644 +target_link_libraries("${LIB_NAME}" pcl_common flann::flann_cpp pcl_octree pcl_kdtree) list(APPEND EXT_DEPS flann) PCL_MAKE_PKGCONFIG(${LIB_NAME} COMPONENT ${SUBSYS_NAME} DESC ${SUBSYS_DESC} PCL_DEPS ${SUBSYS_DEPS}) - + diff --git a/test/features/CMakeLists.txt b/test/features/CMakeLists.txt index 9775415..bf582ac 100644 --- a/test/features/CMakeLists.txt diff --git a/ports/rtabmap/001_opencv.patch b/ports/rtabmap/001_opencv.patch index 5d3a9611ed179e..df83f60dfb07fa 100644 --- a/ports/rtabmap/001_opencv.patch +++ b/ports/rtabmap/001_opencv.patch @@ -1,36 +1,14 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1cb24ae36..a5414e26e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -320,6 +320,9 @@ IF(WITH_QT) - ENDIF() - ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals/foreach and Qt macros - ENDIF(QT4_FOUND OR Qt5_FOUND) -+ELSE() -+ # Unconditionally disable VTK related features since no visualization tools will be built. -+ ADD_DEFINITIONS("-DDISABLE_VTK") - ENDIF(WITH_QT) - - IF(WITH_SUPERPOINT_TORCH) -diff --git a/corelib/src/Features2d.cpp b/corelib/src/Features2d.cpp -index e4048eefb..862cdc68f 100644 ---- a/corelib/src/Features2d.cpp -+++ b/corelib/src/Features2d.cpp -@@ -982,7 +982,7 @@ std::vector SIFT::generateKeypointsImpl(const cv::Mat & image, con - { - UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U); - std::vector keypoints; --#if defined(RTABMAP_NONFREE) || CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) -+#if defined(RTABMAP_NONFREE) && ( CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) ) - cv::Mat imgRoi(image, roi); - cv::Mat maskRoi; - if(!mask.empty()) -@@ -1000,7 +1000,7 @@ cv::Mat SIFT::generateDescriptorsImpl(const cv::Mat & image, std::vector 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) -+#if defined(RTABMAP_NONFREE) && ( CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) ) - _sift->compute(image, keypoints, descriptors); - - if( rootSIFT_ && !descriptors.empty()) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c9adfe34..7e397cdb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -325,6 +325,9 @@ IF(WITH_QT) + ENDIF() + ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals/foreach and Qt macros + ENDIF(QT4_FOUND OR Qt5_FOUND) ++ ELSE() ++ # Unconditionally disable VTK related features since no visualization tools will be built. ++ ADD_DEFINITIONS("-DDISABLE_VTK") + ENDIF(WITH_QT) + + IF(WITH_TORCH) diff --git a/ports/rtabmap/portfile.cmake b/ports/rtabmap/portfile.cmake index e51690c4ec80e6..6f44ecd9241234 100644 --- a/ports/rtabmap/portfile.cmake +++ b/ports/rtabmap/portfile.cmake @@ -3,10 +3,10 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO introlab/rtabmap - REF 0a9d237ac2968463d36c4c9b4436871a6c3ea0ca # 0.20.3 - SHA512 47438eb07e4687855e89664479644b93f826da722c3556c30ed4b1a51cecb41494582d3ae3337ff4e0925f6db7ebf74fe29871bf930bb2eb51f5198090ac8554 + REF 5d777469ff46260991be81cdc4600f5bb8847365 # 0.20.8 + SHA512 8bd7c528f58e78d5f3511dcbdac30ce737e49e570c9583309826bc745e288703fd4e8f5ac631902e67465967a22112856a6c245b45191404c8f4049a44535f93 HEAD_REF master - PATCHES + PATCHES 001_opencv.patch ) @@ -81,7 +81,7 @@ if("tools" IN_LIST FEATURES) ) endif() -file(REMOVE_RECURSE +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" ) diff --git a/ports/rtabmap/vcpkg.json b/ports/rtabmap/vcpkg.json index ef458fd628101f..eedb0c68f1cd1d 100644 --- a/ports/rtabmap/vcpkg.json +++ b/ports/rtabmap/vcpkg.json @@ -1,7 +1,7 @@ { "name": "rtabmap", - "version-string": "0.20.3", - "port-version": 1, + "version-string": "0.20.8", + "port-version": 2, "description": "Real-Time Appearance-Based Mapping", "homepage": "https://introlab.github.io/rtabmap/", "supports": "windows & !static", diff --git a/versions/baseline.json b/versions/baseline.json index 45c19c289afba9..10fa713de40ae6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4586,7 +4586,7 @@ }, "pcl": { "baseline": "1.11.1", - "port-version": 2 + "port-version": 3 }, "pcre": { "baseline": "8.44", diff --git a/versions/p-/pcl.json b/versions/p-/pcl.json index 540bbbf7bc41e4..2a7c8545f6f63d 100644 --- a/versions/p-/pcl.json +++ b/versions/p-/pcl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1b2441792aeedb4f4e766ccb4cd159b9dfa1aa88", + "version-string": "1.11.1", + "port-version": 3 + }, { "git-tree": "7efe6bc9f411b5669ec8ae76407a1250318f3772", "version-string": "1.11.1", diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 5a4d15b968594e..8b383f2bf4e54a 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5d777469ff46260991be81cdc4600f5bb8847365", + "version-string": "0.20.8", + "port-version": 2 + }, { "git-tree": "07422ec8ed79148e476dbb807db950ed78852ca0", "version-string": "0.20.3",