Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTABMap: Port is placed at the wrong location inside the install directory #30205

Closed
Ruhrpottpatriot opened this issue Mar 15, 2023 · 4 comments
Assignees
Labels
category:question This issue is a question

Comments

@Ruhrpottpatriot
Copy link

Describe the bug
This is a follow up on #29467. Even after the fix done by #29570 vcpkgs fails to find RTABMap. However, before the fix I could go in and change the path by myself to find RTABMap. This isn't possible anymore as there doesn't even exist an RTABMapConfig.cmake/rtabmap-config.cmake anymore.

Environment

  • OS: Windows
  • Compiler: MSVC 19.32.31332.0

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install rtabmap:x64-windows (also applies to the x86 triplet)
  2. Create a new project with the following CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(RTABMap_Test VERSION 0.1.0)
 
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
find_package(RTABMap REQUIRED)
find_package(OpenCV REQUIRED)

set(INCLUDE_DIRS
    ${RTABMap_INCLUDE_DIRS}
    ${OpenCV_INCLUDE_DIRS}
)
set(LIBRARIES
    ${RTABMap_LIBRARIES}
    ${OpenCV_LIBRARIES} 
)

include_directories(${INCLUDE_DIRS})
add_executable(RTABMap_Test main.cpp)
target_link_libraries(RTABMap_Test ${LIBRARIES})

and the main.cpp file:

#include <rtabmap/core/Rtabmap.h>

int main(void) {
  return 0;
}

The cmake settings in VSCode are as follows:

 "cmake.configureSettings": {
    "CMAKE_TOOLCHAIN_FILE": "G:/.vcpkg/scripts/buildsystems/vcpkg.cmake",
    "VCPKG_TARGET_TRIPLET": "x64-windows"
  }
  1. build the project

Expected behavior
The build should complete without errors, but doesn't

Failure logs

cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19045.
[cmake] CMake Error at G:/.vcpkg/scripts/buildsystems/vcpkg.cmake:852 (_find_package):
[cmake]   By not providing "FindRTABMap.cmake" in CMAKE_MODULE_PATH this project has
[cmake]   asked CMake to find a package configuration file provided by "RTABMap", but
[cmake]   CMake did not find one.
[cmake] 
[cmake]   Could not find a package configuration file provided by "RTABMap" with any
[cmake]   of the following names:
[cmake] 
[cmake]     RTABMapConfig.cmake
[cmake]     rtabmap-config.cmake
[cmake] 
[cmake]   Add the installation prefix of "RTABMap" to CMAKE_PREFIX_PATH or set
[cmake]   "RTABMap_DIR" to a directory containing one of the above files.  If
[cmake]   "RTABMap" provides a separate development package or SDK, be sure it has
[cmake]   been installed.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:37 (find_package)

Additional context
Add any other context about the problem here.

@Ruhrpottpatriot
Copy link
Author

Ruhrpottpatriot commented Mar 15, 2023

Addendum: I found that changing find_package(RTABMap REQUIRED) to find_package(Unofficial-RTABMap REQUIRED) lets CMake run the config step successfully.
However, the compilation now fails because now the RTABMap files now reside in rtabmap-0.20/rtabmap breaking all includes inside rtabmap as they need to have the rtabmap-0.20 prefixed to their include paths, i.e. #include <rtabmap-0.20/rtabmap/core/RtabmapExp.h> instead of #include <rtabmap/core/RtabmapExp.h>

@Ruhrpottpatriot Ruhrpottpatriot changed the title CMake cannot find RTABMap RTABMap: Port is placed at the wrong location inside the install directory Mar 15, 2023
@jimwang118 jimwang118 added the category:port-bug The issue is with a library, which is something the port should already support label Mar 16, 2023
@dg0yt
Copy link
Contributor

dg0yt commented Mar 19, 2023

A port update is pending in #30254.

@jimwang118
Copy link
Contributor

Addendum: I found that changing find_package(RTABMap REQUIRED) to find_package(Unofficial-RTABMap REQUIRED) lets CMake run the config step successfully. However, the compilation now fails because now the RTABMap files now reside in rtabmap-0.20/rtabmap breaking all includes inside rtabmap as they need to have the rtabmap-0.20 prefixed to their include paths, i.e. #include <rtabmap-0.20/rtabmap/core/RtabmapExp.h> instead of #include <rtabmap/core/RtabmapExp.h>

This should not be a problem, the upstream is in the cmakelist.txt file, and the path with the version number is added to the installed include file path.(https://github.com/introlab/rtabmap/blob/master/CMakeLists.txt#:~:text=set(INSTALL_INCLUDE_DIR%20include,%24%7BDEF_INSTALL_CMAKE_DIR%7D))

@jimwang118 jimwang118 added category:question This issue is a question and removed category:port-bug The issue is with a library, which is something the port should already support labels Mar 20, 2023
@jimwang118
Copy link
Contributor

Thanks for posting this issue. Please reopen this issue if this is still a problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants