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

yaml-cpp is unconditionally linked and included #10

Open
gavanderhoorn opened this issue Jan 5, 2016 · 2 comments
Open

yaml-cpp is unconditionally linked and included #10

gavanderhoorn opened this issue Jan 5, 2016 · 2 comments

Comments

@gavanderhoorn
Copy link
Member

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
Copy link
Contributor

durovsky commented Jan 5, 2016

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
Copy link
Member Author

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.

gavanderhoorn added a commit to gavanderhoorn/siemens_experimental that referenced this issue Jan 9, 2016
gavanderhoorn added a commit to gavanderhoorn/siemens_experimental that referenced this issue Jan 10, 2016
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