aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Yen <seanyen@microsoft.com>2020-11-03 22:51:43 -0800
committerGitHub <noreply@github.com>2020-11-03 22:51:43 -0800
commit9549cd9460a99de41b6c8903c6b024226e7bce64 (patch)
treee1822c95aacfca14ef4c7af0b616c1fda0d2db07
parent75e24fa12478581919b7e65cddaffb87ead2a5a7 (diff)
downloadvcpkg-9549cd9460a99de41b6c8903c6b024226e7bce64.tar.gz
vcpkg-9549cd9460a99de41b6c8903c6b024226e7bce64.zip
[rtabmap] New port (#14299)
-rw-r--r--ports/rtabmap/001_opencv.patch36
-rw-r--r--ports/rtabmap/portfile.cmake46
-rw-r--r--ports/rtabmap/vcpkg.json12
3 files changed, 94 insertions, 0 deletions
diff --git a/ports/rtabmap/001_opencv.patch b/ports/rtabmap/001_opencv.patch
new file mode 100644
index 000000000..5d3a9611e
--- /dev/null
+++ b/ports/rtabmap/001_opencv.patch
@@ -0,0 +1,36 @@
+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<cv::KeyPoint> SIFT::generateKeypointsImpl(const cv::Mat & image, con
+ {
+ UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
+ std::vector<cv::KeyPoint> 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<cv::Key
+ {
+ UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
+ cv::Mat descriptors;
+-#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) )
+ _sift->compute(image, keypoints, descriptors);
+
+ if( rootSIFT_ && !descriptors.empty())
diff --git a/ports/rtabmap/portfile.cmake b/ports/rtabmap/portfile.cmake
new file mode 100644
index 000000000..95c5061d6
--- /dev/null
+++ b/ports/rtabmap/portfile.cmake
@@ -0,0 +1,46 @@
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO introlab/rtabmap
+ REF 0a9d237ac2968463d36c4c9b4436871a6c3ea0ca # 0.20.3
+ SHA512 47438eb07e4687855e89664479644b93f826da722c3556c30ed4b1a51cecb41494582d3ae3337ff4e0925f6db7ebf74fe29871bf930bb2eb51f5198090ac8554
+ HEAD_REF master
+ PATCHES
+ 001_opencv.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS -DWITH_QT=OFF
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
+
+vcpkg_copy_tools(
+ TOOL_NAMES
+ rtabmap-camera
+ rtabmap-console
+ rtabmap-detectMoreLoopClosures
+ rtabmap-export
+ rtabmap-extractObject
+ rtabmap-info
+ rtabmap-kitti_dataset
+ rtabmap-recovery
+ rtabmap-report
+ rtabmap-reprocess
+ rtabmap-res_tool
+ rtabmap-rgbd_dataset
+ AUTO_CLEAN
+)
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+)
+
+configure_file(${SOURCE_PATH}/LICENSE
+ ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY
+)
diff --git a/ports/rtabmap/vcpkg.json b/ports/rtabmap/vcpkg.json
new file mode 100644
index 000000000..5e5ee225b
--- /dev/null
+++ b/ports/rtabmap/vcpkg.json
@@ -0,0 +1,12 @@
+{
+ "name": "rtabmap",
+ "version-string": "0.20.3",
+ "description": "Real-Time Appearance-Based Mapping",
+ "homepage": "https://introlab.github.io/rtabmap/",
+ "supports": "windows & !static",
+ "dependencies": [
+ "opencv",
+ "pcl",
+ "zlib"
+ ]
+}