diff options
Diffstat (limited to 'vcpkg/ports/rtabmap')
| -rw-r--r-- | vcpkg/ports/rtabmap/0001-cmakelists-fixes.patch | 55 | ||||
| -rw-r--r-- | vcpkg/ports/rtabmap/0002-fix-link.patch | 13 | ||||
| -rw-r--r-- | vcpkg/ports/rtabmap/0003-multi-definition.patch | 101 | ||||
| -rw-r--r-- | vcpkg/ports/rtabmap/0004-remove-apple-sys-path.patch | 11 | ||||
| -rw-r--r-- | vcpkg/ports/rtabmap/portfile.cmake | 167 | ||||
| -rw-r--r-- | vcpkg/ports/rtabmap/vcpkg.json | 158 |
6 files changed, 505 insertions, 0 deletions
diff --git a/vcpkg/ports/rtabmap/0001-cmakelists-fixes.patch b/vcpkg/ports/rtabmap/0001-cmakelists-fixes.patch new file mode 100644 index 0000000..b677fb0 --- /dev/null +++ b/vcpkg/ports/rtabmap/0001-cmakelists-fixes.patch @@ -0,0 +1,55 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1faa317b..2157fffb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -264,7 +264,7 @@ endif() + + # OpenMP ("-fopenmp" should be added for flann included in PCL) + # the gcc-4.2.1 coming with MacOS X is not compatible with the OpenMP pragmas we use, so disabling OpenMP for it +-if(((NOT APPLE) OR (NOT CMAKE_COMPILER_IS_GNUCXX) OR (GCC_VERSION VERSION_GREATER 4.2.1) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) AND WITH_OPENMP) ++if(WITH_OPENMP) + find_package(OpenMP COMPONENTS C CXX) + endif() + if(OPENMP_FOUND) +@@ -633,10 +633,12 @@ IF(WITH_REALSENSE) + ENDIF(WITH_REALSENSE) + + IF(WITH_REALSENSE2) +- IF(WIN32) ++ IF(0) + FIND_PACKAGE(RealSense2 QUIET) + ELSE() + FIND_PACKAGE(realsense2 QUIET) ++ set(RealSense2_LIBRARIES realsense2::realsense2) ++ set(realsense2_LIBRARIES realsense2::realsense2) + ENDIF() + IF(realsense2_FOUND) + MESSAGE(STATUS "Found RealSense2: ${realsense2_INCLUDE_DIRS}") +@@ -977,14 +979,14 @@ IF(NOT realsense2_FOUND) + SET(CONF_WITH_REALSENSE2 0) + ELSE() + SET(CONF_WITH_REALSENSE2 1) +- IF(WIN32) ++ IF(0) + install( + FILES + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindRealSense2.cmake" + DESTINATION ${INSTALL_CMAKE_DIR}/Modules/. + COMPONENT devel + ) +- ENDIF(WIN32) ++ ENDIF(0) + ENDIF() + IF(NOT mynteye_FOUND) + SET(MYNTEYE "//") +diff --git a/utilite/resource_generator/CMakeLists.txt b/utilite/resource_generator/CMakeLists.txt +index 82f12535..f1a1c8aa 100644 +--- a/utilite/resource_generator/CMakeLists.txt ++++ b/utilite/resource_generator/CMakeLists.txt +@@ -1,5 +1,5 @@ + +-if (CMAKE_CROSSCOMPILING OR ANDROID OR IOS) ++if (CMAKE_CROSSCOMPILING OR ANDROID OR IOS OR RTABMAP_RES_TOOL) + # See this page about tools being required in the build: + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/CrossCompiling#using-executables-in-the-build-created-during-the-build + diff --git a/vcpkg/ports/rtabmap/0002-fix-link.patch b/vcpkg/ports/rtabmap/0002-fix-link.patch new file mode 100644 index 0000000..6d329a9 --- /dev/null +++ b/vcpkg/ports/rtabmap/0002-fix-link.patch @@ -0,0 +1,13 @@ +--- a/corelib/src/global_map/OctoMap.cpp ++++ b/corelib/src/global_map/OctoMap.cpp +@@ -278,10 +278,8 @@ RtabmapColorOcTree::StaticMemberInitializer::StaticMemberInitializer() { + AbstractOcTree::registerTreeType(tree); + } + +-#ifndef _WIN32 + // On Windows, the app freezes on start if the following is defined + RtabmapColorOcTree::StaticMemberInitializer RtabmapColorOcTree::RtabmapColorOcTreeMemberInit; +-#endif + + + ////////////////////////////////////// diff --git a/vcpkg/ports/rtabmap/0003-multi-definition.patch b/vcpkg/ports/rtabmap/0003-multi-definition.patch new file mode 100644 index 0000000..12cfe93 --- /dev/null +++ b/vcpkg/ports/rtabmap/0003-multi-definition.patch @@ -0,0 +1,101 @@ +--- a/corelib/include/rtabmap/core/stereo/stereoRectifyFisheye.h ++++ b/corelib/include/rtabmap/core/stereo/stereoRectifyFisheye.h +@@ -39,6 +39,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #if CV_MAJOR_VERSION >= 4 + #include <opencv2/core/core_c.h> + ++#include <rtabmap/core/rtabmap_core_export.h> ++ ++namespace { ++ + // Opencv4 doesn't expose those functions below anymore, we should recopy all of them! + int cvRodrigues2( const CvMat* src, CvMat* dst, CvMat* jacobian CV_DEFAULT(0)) + { +@@ -915,6 +919,8 @@ void cvConvertPointsHomogeneous( const CvMat* _src, CvMat* _dst ) + } + } + ++} // namespace ++ + #endif // OpenCV4 + + #endif // OpenCV3 +@@ -923,9 +929,11 @@ namespace rtabmap + { + + void ++RTABMAP_CORE_EXPORT + icvGetRectanglesFisheye( const CvMat* cameraMatrix, const CvMat* distCoeffs, + const CvMat* R, const CvMat* newCameraMatrix, CvSize imgSize, + cv::Rect_<float>& inner, cv::Rect_<float>& outer ) ++#ifdef RTABMAP_STEREORECTIFIYFISHEYE_IMPLEMENTATION + { + const int N = 9; + int x, y, k; +@@ -967,12 +975,17 @@ icvGetRectanglesFisheye( const CvMat* cameraMatrix, const CvMat* distCoeffs, + inner = cv::Rect_<float>(iX0, iY0, iX1-iX0, iY1-iY0); + outer = cv::Rect_<float>(oX0, oY0, oX1-oX0, oY1-oY0); + } ++#else ++; ++#endif + +-void cvStereoRectifyFisheye( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2, ++void RTABMAP_CORE_EXPORT ++ cvStereoRectifyFisheye( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2, + const CvMat* _distCoeffs1, const CvMat* _distCoeffs2, + CvSize imageSize, const CvMat* matR, const CvMat* matT, + CvMat* _R1, CvMat* _R2, CvMat* _P1, CvMat* _P2, + CvMat* matQ, int flags, double alpha, CvSize newImgSize ) ++#ifdef RTABMAP_STEREORECTIFIYFISHEYE_IMPLEMENTATION + { + double _om[3], _t[3] = {0}, _uu[3]={0,0,0}, _r_r[3][3], _pp[3][4]; + double _ww[3], _wr[3][3], _z[3] = {0,0,0}, _ri[3][3], _w3[3]; +@@ -1177,19 +1190,25 @@ void cvStereoRectifyFisheye( const CvMat* _cameraMatrix1, const CvMat* _cameraMa + cvConvert( &Q, matQ ); + } + } ++#else ++; ++#endif ++ + +-void stereoRectifyFisheye( cv::InputArray _cameraMatrix1, cv::InputArray _distCoeffs1, ++void RTABMAP_CORE_EXPORT ++ stereoRectifyFisheye( cv::InputArray _cameraMatrix1, cv::InputArray _distCoeffs1, + cv::InputArray _cameraMatrix2, cv::InputArray _distCoeffs2, + cv::Size imageSize, cv::InputArray _Rmat, cv::InputArray _Tmat, + cv::OutputArray _Rmat1, cv::OutputArray _Rmat2, + cv::OutputArray _Pmat1, cv::OutputArray _Pmat2, + cv::OutputArray _Qmat, int flags, + double alpha, cv::Size newImageSize) ++#ifdef RTABMAP_STEREORECTIFIYFISHEYE_IMPLEMENTATION + { + cv::Mat cameraMatrix1 = _cameraMatrix1.getMat(), cameraMatrix2 = _cameraMatrix2.getMat(); + cv::Mat distCoeffs1 = _distCoeffs1.getMat(), distCoeffs2 = _distCoeffs2.getMat(); + cv::Mat Rmat = _Rmat.getMat(), Tmat = _Tmat.getMat(); +- ++ + #if CV_MAJOR_VERSION > 3 || (CV_MAJOR_VERSION >= 3 && (CV_MINOR_VERSION>4 || (CV_MINOR_VERSION>=4 && CV_SUBMINOR_VERSION>=4))) + CvMat c_cameraMatrix1 = cvMat(cameraMatrix1); + CvMat c_cameraMatrix2 = cvMat(cameraMatrix2); +@@ -1238,6 +1257,9 @@ void stereoRectifyFisheye( cv::InputArray _cameraMatrix1, cv::InputArray _distCo + CvSize(newImageSize)); + #endif + } ++#else ++; ++#endif + + } + +--- a/corelib/src/StereoCameraModel.cpp ++++ b/corelib/src/StereoCameraModel.cpp +@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + #include <opencv2/imgproc/imgproc.hpp> + + #if CV_MAJOR_VERSION > 2 or (CV_MAJOR_VERSION == 2 and (CV_MINOR_VERSION >4 or (CV_MINOR_VERSION == 4 and CV_SUBMINOR_VERSION >=10))) ++#define RTABMAP_STEREORECTIFIYFISHEYE_IMPLEMENTATION + #include <rtabmap/core/stereo/stereoRectifyFisheye.h> + #endif + diff --git a/vcpkg/ports/rtabmap/0004-remove-apple-sys-path.patch b/vcpkg/ports/rtabmap/0004-remove-apple-sys-path.patch new file mode 100644 index 0000000..692b08e --- /dev/null +++ b/vcpkg/ports/rtabmap/0004-remove-apple-sys-path.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -119,8 +119,6 @@ endif() + #Other paths... + IF(APPLE) + # For Mac ports +- SET(CMAKE_INCLUDE_PATH "/opt/local/include;${CMAKE_INCLUDE_PATH}") +- SET(CMAKE_LIBRARY_PATH "/opt/local/lib;${CMAKE_LIBRARY_PATH}") + ENDIF() + + ####### Build libraries as shared or static ####### diff --git a/vcpkg/ports/rtabmap/portfile.cmake b/vcpkg/ports/rtabmap/portfile.cmake new file mode 100644 index 0000000..3f92f28 --- /dev/null +++ b/vcpkg/ports/rtabmap/portfile.cmake @@ -0,0 +1,167 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO introlab/rtabmap
+ REF ${VERSION}
+ SHA512 9bcd0f359e0ee8060cf7088761544a3f7d38aadb37df820958f0811aa7b8edbfaf00f00d9472a8bf46261d4e5d868f9c10785263aaabaf374b6e5aa5237d70b0
+ HEAD_REF master
+ PATCHES
+ 0001-cmakelists-fixes.patch
+ 0002-fix-link.patch
+ 0003-multi-definition.patch
+ 0004-remove-apple-sys-path.patch
+)
+# Will use vcpkg to find these packages
+file(REMOVE_RECURSE
+ "${SOURCE_PATH}/cmake_modules/FindEigen3.cmake"
+ "${SOURCE_PATH}/cmake_modules/FindRealSense2.cmake"
+ "${SOURCE_PATH}/src/sqlite3"
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ gui WITH_QT
+ gui VCPKG_LOCK_FIND_PACKAGE_Qt6
+ gui VCPKG_LOCK_FIND_PACKAGE_VTK
+ k4w2 WITH_K4W2
+ k4w2 VCPKG_LOCK_FIND_PACKAGE_KinectSDK2
+ octomap WITH_OCTOMAP
+ octomap VCPKG_LOCK_FIND_PACKAGE_octomap
+ openmp WITH_OPENMP
+ openmp VCPKG_LOCK_FIND_PACKAGE_OpenMP
+ openni2 WITH_OPENNI2
+ openni2 VCPKG_LOCK_FIND_PACKAGE_OpenNI2
+ realsense2 WITH_REALSENSE2
+ realsense2 VCPKG_LOCK_FIND_PACKAGE_realsense2
+ tools BUILD_APP
+ tools BUILD_TOOLS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS_DEBUG
+ -DBUILD_TOOLS=OFF
+ -DBUILD_APP=OFF
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ "-DRTABMAP_RES_TOOL=${CURRENT_HOST_INSTALLED_DIR}/tools/rtabmap-res-tool/rtabmap-res_tool${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
+ -DRTABMAP_QT_VERSION=6
+ -DBUILD_AS_BUNDLE=OFF
+ -DBUILD_EXAMPLES=OFF
+ -DVCPKG_LOCK_FIND_PACKAGE_SQLite3=ON
+ ## always on feats
+ -DWITH_G2O=ON -DVCPKG_LOCK_FIND_PACKAGE_g2o=ON
+ -DWITH_CERES=ON
+ -DWITH_ORB_OCTREE=ON # GPLv3
+ ## always off feats
+ -DWITH_ALICE_VISION=OFF
+ -DWITH_ARCore=OFF
+ -DWITH_ARENGINE=OFF
+ -DWITH_CCCORELIB=OFF
+ -DWITH_CPUTSDF=OFF
+ -DWITH_CVSBA=OFF
+ -DWITH_DC1394=OFF
+ -DWITH_DEPTHAI=OFF
+ -DWITH_DVO=OFF
+ -DWITH_FASTCV=OFF
+ -DWITH_FLOAM=OFF
+ -DWITH_FLYCAPTURE2=OFF
+ -DWITH_FOVIS=OFF
+ -DWITH_FREENECT=OFF
+ -DWITH_FREENECT2=OFF
+ -DWITH_GRIDMAP=OFF
+ -DWITH_GTSAM=OFF
+ -DWITH_K4A=OFF
+ -DWITH_LOAM=OFF
+ -DWITH_MADGWICK=OFF
+ -DWITH_MRPT=OFF
+ -DWITH_MSCKF_VIO=OFF
+ -DWITH_MYNTEYE=OFF
+ -DWITH_OKVIS=OFF
+ -DWITH_OPEN3D=OFF
+ -DWITH_OPENCHISEL=OFF
+ -DWITH_OPENGV=OFF
+ -DWITH_OPENVINS=OFF
+ -DWITH_ORB_SLAM=OFF
+ -DWITH_PDAL=OFF
+ -DWITH_POINTMATCHER=OFF
+ -DWITH_PYTHON=OFF
+ -DWITH_PYTHON_THREADING=OFF
+ -DWITH_REALSENSE=OFF
+ -DWITH_REALSENSE_SLAM=OFF
+ -DWITH_TANGO=OFF
+ -DWITH_TORCH=OFF
+ -DWITH_VERTIGO=OFF
+ -DWITH_VINS=OFF
+ -DWITH_VISO2=OFF
+ -DWITH_ZED=OFF
+ -DWITH_ZEDOC=OFF
+ MAYBE_UNUSED_VARIABLES
+ VCPKG_LOCK_FIND_PACKAGE_Qt6
+ VCPKG_LOCK_FIND_PACKAGE_VTK
+ VCPKG_LOCK_FIND_PACKAGE_KinectSDK2
+ VCPKG_LOCK_FIND_PACKAGE_octomap
+ VCPKG_LOCK_FIND_PACKAGE_OpenMP
+ VCPKG_LOCK_FIND_PACKAGE_OpenNI2
+ VCPKG_LOCK_FIND_PACKAGE_realsense2
+ VCPKG_LOCK_FIND_PACKAGE_RealSense2
+ # Android
+ WITH_ARCore
+ WITH_ARENGINE
+ WITH_TANGO
+)
+
+vcpkg_cmake_install()
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
+else()
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/rtabmap-0.23)
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if("tools" IN_LIST FEATURES)
+ 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-rgbd_dataset
+ rtabmap-euroc_dataset
+ rtabmap-cleanupLocalGrids
+ rtabmap-globalBundleAdjustment
+ AUTO_CLEAN
+ )
+ if("gui" IN_LIST FEATURES)
+ vcpkg_copy_tools(
+ TOOL_NAMES
+ rtabmap
+ rtabmap-calibration
+ rtabmap-databaseViewer
+ rtabmap-dataRecorder
+ rtabmap-odometryViewer
+ rtabmap-rgbd_camera
+ rtabmap-lidar_viewer
+ AUTO_CLEAN
+ )
+ file(COPY "${CURRENT_INSTALLED_DIR}/tools/Qt6/bin/qt.conf" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf" "./../../../" "./../../")
+ endif()
+endif()
+
+vcpkg_install_copyright(
+ COMMENT [[
+The RTAB-Map main license is BSD-3-Clause, but some parts of the
+source code are under other licenses possibly including GPL-3.0-only.
+]]
+ FILE_LIST "${SOURCE_PATH}/LICENSE"
+)
diff --git a/vcpkg/ports/rtabmap/vcpkg.json b/vcpkg/ports/rtabmap/vcpkg.json new file mode 100644 index 0000000..3d3edd8 --- /dev/null +++ b/vcpkg/ports/rtabmap/vcpkg.json @@ -0,0 +1,158 @@ +{ + "name": "rtabmap", + "version": "0.23.2", + "description": "Real-Time Appearance-Based Mapping", + "homepage": "https://introlab.github.io/rtabmap/", + "license": null, + "dependencies": [ + "boost-crc", + "ceres", + "g2o", + { + "name": "opencv", + "default-features": false, + "features": [ + "fs", + "intrinsics", + "thread" + ] + }, + { + "name": "pcl", + "default-features": false + }, + { + "name": "rtabmap-res-tool", + "host": true + }, + "sqlite3", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ], + "default-features": [ + "gui", + "opencv-contrib", + "opencv-nonfree", + { + "name": "openmp", + "platform": "!osx" + } + ], + "features": { + "gui": { + "description": "Build RTAB-Map with GUI support (Qt)", + "dependencies": [ + { + "name": "pcl", + "default-features": false, + "features": [ + "qt", + "visualization" + ] + }, + { + "name": "qtbase", + "default-features": false, + "features": [ + "gui", + "opengl", + "widgets" + ] + }, + { + "name": "vtk", + "default-features": false + } + ] + }, + "k4w2": { + "description": "Build RTAB-Map with Kinect For Windows SDK 2.0 camera driver", + "dependencies": [ + "kinectsdk2" + ] + }, + "octomap": { + "description": "Build RTAB-Map with OctoMap support", + "dependencies": [ + "octomap" + ] + }, + "opencv-contrib": { + "description": "Use OpenCV with contrib modules (e.g., xfeatures2d, aruco)", + "dependencies": [ + { + "name": "opencv", + "default-features": false, + "features": [ + "contrib", + "fs", + "intrinsics", + "thread" + ] + } + ] + }, + "opencv-cuda": { + "description": "Use OpenCV with CUDA (accelerated SIFT ad SURF GPU options)", + "dependencies": [ + { + "name": "opencv", + "default-features": false, + "features": [ + "cuda", + "fs", + "intrinsics", + "thread" + ] + } + ] + }, + "opencv-nonfree": { + "description": "Use OpenCV with nonfree module (surf feature)", + "dependencies": [ + { + "name": "opencv", + "default-features": false, + "features": [ + "fs", + "intrinsics", + "nonfree", + "thread" + ] + } + ] + }, + "openmp": { + "description": "Enable OpenMP parallel execution" + }, + "openni2": { + "description": "Build RTAB-Map with OpenNI2 camera driver", + "dependencies": [ + "kinectsdk1", + "openni2" + ] + }, + "realsense2": { + "description": "Build RTAB-Map with RealSense2 camera driver", + "dependencies": [ + { + "name": "realsense2", + "default-features": false + } + ] + }, + "tools": { + "description": "Build RTAB-Map's tools", + "dependencies": [ + "yaml-cpp" + ] + } + } +} |