ros-industrial / siemens_experimental

Apache License 2.0
8 stars 6 forks source link

yaml-cpp is unconditionally linked and included #10

Open gavanderhoorn opened 8 years ago

gavanderhoorn commented 8 years ago

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.

durovsky commented 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()

gavanderhoorn commented 8 years ago

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.