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

find_dependency(yaml-cpp REQUIRED) #563

Open
lrineau opened this issue Apr 30, 2024 · 0 comments
Open

find_dependency(yaml-cpp REQUIRED) #563

lrineau opened this issue Apr 30, 2024 · 0 comments
Assignees

Comments

@lrineau
Copy link

lrineau commented Apr 30, 2024

yaml-cpp is a required dependency:

message(STATUS "Looking for yaml-cpp on system...")
find_package(yaml-cpp CONFIG REQUIRED)

It should be added as a dependency in libpointmatcherConfig.cmake.in, like libnano:

include(CMakeFindDependencyMacro)
find_dependency(libnabo REQUIRED)
find_package(Boost COMPONENTS thread filesystem system program_options date_time REQUIRED)
if (Boost_MINOR_VERSION GREATER 47)
find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono REQUIRED)
endif ()

My proposed patch is add

 find_dependency(yaml-cpp REQUIRED)

after line 8 of libpointmatcherConfig.cmake.in.

Without that patch, a CMake user of libpointmatcherConfig.cmake gets a CMake error:

CMake Error at Installation/cmake/modules/CGAL_pointmatcher_support.cmake:12 (target_link_libraries):
  The link interface of target "CGAL::pointmatcher_support" contains:

    yaml-cpp::yaml-cpp

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

see a faulty CI testsuite log at https://github.com/CGAL/cgal-testsuite-dockerfiles/actions/runs/8891254550/job/24412843289#step:3:10198.

For information, the target CGAL::pointmatcher_support is created by the file CGAL_pointmatcher_support.cmake of CGAL, that contains:

if(libpointmatcher_FOUND AND NOT TARGET CGAL::pointmatcher_support)
  find_package(Boost COMPONENTS thread filesystem system program_options date_time chrono)
  if(Boost_chrono_FOUND
      AND Boost_thread_FOUND
      AND Boost_filesystem_FOUND
      AND Boost_system_FOUND
      AND Boost_program_options_FOUND
      AND Boost_date_time_FOUND)
    add_library(CGAL::pointmatcher_support INTERFACE IMPORTED)
    target_compile_definitions(CGAL::pointmatcher_support INTERFACE "CGAL_LINKED_WITH_POINTMATCHER")
    target_include_directories(CGAL::pointmatcher_support INTERFACE "${libpointmatcher_INCLUDE_DIR}")
    target_link_libraries(CGAL::pointmatcher_support INTERFACE ${libpointmatcher_LIBRARIES} libnabo::nabo)
  else()
    message(STATUS "NOTICE: the libpointmatcher library requires the following boost components: thread filesystem system program_options date_time chrono.")
  endif()
endif()

cc: @soesau We have a CMake error with the new released Ubuntu 24.084, that ships yaml-cpp version 0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants