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

CMake: Add compatibility for yaml-cpp 0.8.0. #1115

Merged
merged 1 commit into from
Aug 19, 2023
Merged

CMake: Add compatibility for yaml-cpp 0.8.0. #1115

merged 1 commit into from
Aug 19, 2023

Conversation

FtZPetruska
Copy link
Contributor

When packaging yaml-cpp 0.8.0 on vcpkg, there were build issues with rtabmap.

Notably, the debug build fails due to LIBRARIES having yaml-cpp hardcoded, while yaml-cpp has a debug postfix. This, in combination with 0.8.0 renaming the target to yaml-cpp::yaml-cpp means that yaml-cpp is treated as a literal library name.

This PR updates the find logic to address these issues:

  • For the include directories, the variable name used upstream is YAML_CPP_INCLUDE_DIR.
  • The target name in 0.8.0 changed to yaml-cpp::yaml-cpp, but the variable YAML_CPP_LIBRARIES was not updated. This issue has already been reported upstream, but when this specific version of yaml-cpp is found, just overwrite the YAML_CPP_LIBRARIES with the correct target name.

- Upstream uses YAML_CPP_INCLUDE_DIR
- yaml-cpp 0.8.0 does not set YAML_CPP_LIBRARIES to the new target name.
- Debug builds of yaml-cpp suffix the library with `d`.
@matlabbe
Copy link
Member

I also prefer usage of targets, thanks for the update!

@matlabbe matlabbe merged commit f2687ed into introlab:master Aug 19, 2023
@FtZPetruska FtZPetruska deleted the fix-yaml-cpp branch August 19, 2023 16:13
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

Successfully merging this pull request may close these issues.

2 participants