Skip to content

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

Merged
matlabbe merged 1 commit intointrolab:masterfrom
FtZPetruska:fix-yaml-cpp
Aug 19, 2023
Merged

CMake: Add compatibility for yaml-cpp 0.8.0.#1115
matlabbe merged 1 commit intointrolab:masterfrom
FtZPetruska:fix-yaml-cpp

Conversation

@FtZPetruska
Copy link
Copy Markdown
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
Copy Markdown
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