Open gavanderhoorn opened 8 years ago
Could this be a solution?
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(NEW_YAMLCPP yaml-cpp)
endif()
if(NEW_YAMLCPP_FOUND)
target_link_libraries(${PROJECT_NAME} yaml-cpp)
endif()
It is part of a solution, yes. I'd do it slightly differently (finding yaml-cpp itself does not necessarily mean that it is the new version). If you can give me some time, I'll propose something in a PR.
The current
CMakeLists.txt
(here) does not do any detection of the required yaml-cpp dependency, but unconditionally links against it.This will fail on systems without yaml-cpp, or with yaml-cpp outside the standard include and link paths and should be fixed.