[rtabmap] Fix CMake config export (#29570)

* [rtabmap] Fix CMake config export

* update version
This commit is contained in:
Lily Wang 2023-03-02 09:13:56 +08:00 committed by GitHub
parent ed73411424
commit 92a252b04b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 5 deletions

View File

@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef02aa0..32a1e38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1656,3 +1656,22 @@ MESSAGE(SEND_ERROR "No graph optimizer found! You should have at least one of th
ENDIF(NOT GTSAM_FOUND AND NOT G2O_FOUND AND NOT WITH_TORO AND NOT WITH_CERES AND NOT CERES_FOUND)
# vim: set et ft=cmake fenc=utf-8 ff=unix sts=0 sw=2 ts=2 :
+
+SET(install_targets rtabmap_utilite rtabmap_core)
+TARGET_INCLUDE_DIRECTORIES(rtabmap_utilite INTERFACE $<INSTALL_INTERFACE:include/rtabmap-0.20>)
+TARGET_INCLUDE_DIRECTORIES(rtabmap_core INTERFACE $<INSTALL_INTERFACE:include/rtabmap-0.20>)
+INSTALL(TARGETS ${install_targets} EXPORT unofficial-rtabmap-config)
+
+INSTALL(EXPORT unofficial-rtabmap-config
+ NAMESPACE unofficial::rtabmap::
+ DESTINATION share/unofficial-rtabmap
+ FILE unofficial-rtabmap-config.cmake
+)
+
+INCLUDE(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-rtabmapConfigVersion.cmake"
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY SameMajorVersion)
+
+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-rtabmapConfigVersion.cmake" DESTINATION "share/unofficial-rtabmap")

View File

@ -11,6 +11,7 @@ vcpkg_from_github(
PATCHES
0003-fix-qt.patch
cpp17.patch
fix-CMake-export.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -19,7 +20,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${FEATURE_OPTIONS}
@ -69,7 +70,18 @@ vcpkg_cmake_configure(
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-rtabmap CONFIG_PATH share/unofficial-rtabmap)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/unofficial-rtabmap/unofficial-rtabmap-config.cmake"
[[# Generated by CMake]]
[[# Generated by CMake
include(CMakeFindDependencyMacro)
find_dependency(OpenCV)
find_dependency(PCL)
find_dependency(ZLIB)
find_dependency(VTK)
find_dependency(OpenMP)]]
)
vcpkg_copy_tools(TOOL_NAMES rtabmap-res_tool AUTO_CLEAN)
@ -97,6 +109,8 @@ endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/CMake"
"${CURRENT_PACKAGES_DIR}/CMake"
)
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,7 +1,7 @@
{
"name": "rtabmap",
"version": "0.20.23",
"port-version": 1,
"port-version": 2,
"description": "Real-Time Appearance-Based Mapping",
"homepage": "https://introlab.github.io/rtabmap/",
"license": "BSD-3-Clause",

View File

@ -6934,7 +6934,7 @@
},
"rtabmap": {
"baseline": "0.20.23",
"port-version": 1
"port-version": 2
},
"rtaudio": {
"baseline": "2021-11-16",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f820f54d02aada9453b8d26fb72d03dc30e04bf9",
"version": "0.20.23",
"port-version": 2
},
{
"git-tree": "f9f15f5c198b5b94b443fdcf6dfc69edebcc4d0b",
"version": "0.20.23",