"spdlog::spdlog" target missing when including g2o in another cmake project
matlabbe opened this issue · comments
matlabbe commented
It seems that this pull request #678 added spdlog logging ON by default. As the included target is public:
if (G2O_HAVE_LOGGING)
if(TARGET spdlog::spdlog)
target_link_libraries(stuff PUBLIC spdlog::spdlog)
else()
target_link_libraries(stuff PUBLIC spdlog::spdlog_header_only)
endif()
endif()
The https://github.com/RainerKuemmerle/g2o/blob/master/cmake_modules/Config.cmake.in could have
if(@G2O_HAVE_LOGGING@)
find_dependency(spdlog)
endif()
to let downstream packages including spdlog target.
Rainer Kümmerle commented
Thanks. I added a commit with your suggested fix.
matlabbe commented
Great! thx