diff options
| author | Lars Glud <larshg@gmail.com> | 2021-05-26 23:48:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-26 14:48:21 -0700 |
| commit | 2462a956c8068e4dab8aa8bbe9a406016106e188 (patch) | |
| tree | e6286f53d1f97e0df41bb3c4b310068e11acf286 /ports/pcl | |
| parent | 7234002d11141cc6376334b80a7fdde9f8f2668e (diff) | |
| download | vcpkg-2462a956c8068e4dab8aa8bbe9a406016106e188.tar.gz vcpkg-2462a956c8068e4dab8aa8bbe9a406016106e188.zip | |
[FLANN] Allow to be build as shared lib (#16724)
* Allow FLANN to be build as shared lib
* Fix openmvg linking to FLANN
* Fix pcl linking to FLANN
Diffstat (limited to 'ports/pcl')
| -rw-r--r-- | ports/pcl/add-gcc-version-check.patch | 18 | ||||
| -rw-r--r-- | ports/pcl/portfile.cmake | 3 | ||||
| -rw-r--r-- | ports/pcl/use_flann_targets.patch | 97 | ||||
| -rw-r--r-- | ports/pcl/vcpkg.json | 2 |
4 files changed, 16 insertions, 104 deletions
diff --git a/ports/pcl/add-gcc-version-check.patch b/ports/pcl/add-gcc-version-check.patch index dbef34b63..a21b9e473 100644 --- a/ports/pcl/add-gcc-version-check.patch +++ b/ports/pcl/add-gcc-version-check.patch @@ -1,10 +1,19 @@ +From 8a7a883b51e18645974921b1bfe9d3b6ef3c626c Mon Sep 17 00:00:00 2001 +From: Lars Glud <larshg@gmail.com> +Date: Fri, 19 Mar 2021 22:22:57 +0100 +Subject: [PATCH] Add gcc-version-check + +--- + CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6c452ce..2c50b8d 100644 +index e5aa7f40a..1e346a316 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -303,6 +303,10 @@ set(FLANN_USE_STATIC ON) +@@ -304,6 +304,10 @@ if(NOT PCL_SHARED_LIBS OR ((WIN32 AND NOT MINGW) AND NOT PCL_BUILD_WITH_FLANN_DY + endif() find_package(FLANN 1.7.0 REQUIRED) - find_package(lz4) +if(UNIX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + set (CMAKE_CXX_STANDARD 17) @@ -13,3 +22,6 @@ index 6c452ce..2c50b8d 100644 # libusb-1.0 option(WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE) if(WITH_LIBUSB) +-- +2.29.2.windows.2 + diff --git a/ports/pcl/portfile.cmake b/ports/pcl/portfile.cmake index 2d5c8cb06..008b8934e 100644 --- a/ports/pcl/portfile.cmake +++ b/ports/pcl/portfile.cmake @@ -7,7 +7,6 @@ vcpkg_from_github( PATCHES pcl_utils.patch pcl_config.patch - use_flann_targets.patch boost-1.70.patch fix-link-libpng.patch remove-broken-targets.patch @@ -17,9 +16,7 @@ vcpkg_from_github( fix-find-qhull.patch ) -file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindFLANN.cmake) file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindQhull.cmake) - string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PCL_SHARED_LIBS) if ("cuda" IN_LIST FEATURES AND VCPKG_TARGET_ARCHITECTURE STREQUAL x86) diff --git a/ports/pcl/use_flann_targets.patch b/ports/pcl/use_flann_targets.patch deleted file mode 100644 index a948cc010..000000000 --- a/ports/pcl/use_flann_targets.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 93a6448..b24f681 100644 ---- a/CMakeLists.txt -+++ 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) --endif() -+set(FLANN_USE_STATIC ON) - find_package(FLANN 1.7.0 REQUIRED) -+find_package(lz4) - - # libusb-1.0 - 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) -- set(BOOST_ROOT "${PCL_ROOT}/3rdParty/Boost") -- elseif(NOT BOOST_INCLUDEDIR) -- set(BOOST_INCLUDEDIR "@Boost_INCLUDE_DIR@") -- endif() - # use static Boost in Windows - 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) -- list(APPEND PCL_LIBRARIES FLANN::FLANN) -+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}) -diff --git a/kdtree/CMakeLists.txt b/kdtree/CMakeLists.txt -index 826e902..f714130 100644 ---- a/kdtree/CMakeLists.txt -+++ b/kdtree/CMakeLists.txt -@@ -31,7 +31,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_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 -+++ 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_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 -+++ 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_cpp) - PCL_ADD_TEST(a_ii_normals_test test_ii_normals - FILES test_ii_normals.cpp - LINK_WITH pcl_gtest pcl_io pcl_features diff --git a/ports/pcl/vcpkg.json b/ports/pcl/vcpkg.json index 49f28913a..4f0fa3a87 100644 --- a/ports/pcl/vcpkg.json +++ b/ports/pcl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "pcl", "version": "1.11.1", - "port-version": 3, + "port-version": 4, "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)", |
