norlab-ulaval / libpointmatcher

An Iterative Closest Point (ICP) library for 2D and 3D mapping in Robotics
BSD 3-Clause "New" or "Revised" License
1.61k stars 544 forks source link

yaml-cpp-pm not found when I run find_package(libpointmatcher) #429

Closed maximecharriere closed 3 years ago

maximecharriere commented 3 years ago

Issue Details

Hello, when I try to build the Point_set_processing_3 examples from CGAL, I got a CMake error from libpointmatcherConfig.cmake. He try to load C:/dev/libpointmatcher/build/yaml-cpp-pm-targets.cmake when the file is located in C:/dev/libpointmatcher/build/contrib/yaml-cpp-pm/CMakeFiles/Export/share/libpointmatcher/cmake/yaml-cpp-pm-targets.cmake and it tell me that the configuration is incomplete, so I can't go any further.

Do you know what could be a solution?

And what's the difference between libpointmatcherConfig.cmake and libpointmatcher-config.cmake ? How CMake know witch one to choose when finding a package ?

CMake output

CMake Error at C:/dev/libpointmatcher/build/libpointmatcherConfig.cmake:10 (include):
  include could not find load file:

    C:/dev/libpointmatcher/build/yaml-cpp-pm-targets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:93 (find_package)

Configuring incomplete, errors occurred!

Environment

maximecharriere commented 3 years ago

I resolved this issue by using make install instead of just make so all cmake files are in ${CMAKE_INSTALL_PREFIX}/share/libpointmatcher/cmake.

In this way, these two include in libpointmatcherConfig.cmake can be found

9>  include(${CMAKE_CURRENT_LIST_DIR}/libpointmatcher-config.cmake)
10> include(${CMAKE_CURRENT_LIST_DIR}/yaml-cpp-pm-targets.cmake)

Otherwise yaml-cpp-pm-targets.cmake would be in another directory.