Support discovery of TinyXML2 by pkgconfig #5697
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow to discovery TinyXML2 by pkg-config is a
-config.cmake
file is not available.Since tinyxml2 is built with meson in Yocto it's configuration gets deployed by
pkg-config
(because meson cannot generate CMake target files). In this case, the currentFindTinyXML2.cmake
will find out the path oftinyxml2.h
and oftinyxml2.so
by looking into therecipe-sysroot
folder, which path in going to get expanded into thefastrtps-target.cmake
generated when fastdds is built. The end result is that we're going to have a system-wide deployed config mode package that points to a directory that won't (probably) not exist anymore when other dependent targets are built.Since it's not possible to force meson to produce a
tinyxml2-target.cmake
file, the most reasonable solution is trying to look for the library by pkg-config.With this patch applied, the generated
fastrtps-target.cmake
will have a reference to the targetPkgConfig::TinyXML2
instead of a full path.Note that embedding TinyXML2 without symbol leaking it's not possible since they declare interfaces with
default
visibility. Which means that while creating an image we must have one and only one version of TinyXML2 around. Which basically makes impossible to use the bundled one in thirdpartyContributor Checklist
versions.md
file (if applicable).Reviewer Checklist