RainerKuemmerle / g2o

g2o: A General Framework for Graph Optimization

Home Page:http://openslam.org/g2o.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"spdlog::spdlog" target missing when including g2o in another cmake project

matlabbe opened this issue · comments

See introlab/rtabmap#1031

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.

Thanks. I added a commit with your suggested fix.

Great! thx