fix detecting & using utf8c++ 4.0.0 or newer - #353
Merged
Conversation
`find_package` with version constraint `3.2.0` does not consider 4.x.y to be compatible. Therefore also look for 4.x.y in a secondary `find_package` call. The fallback for cloning from git if neither version is found via `cmake` remains in place. Furthermore, linking against a distro-packaged 4.x.y doesn't seem to work with the existing `target_link_libraries(ebml PRIVATE $<BUILD_INTERFACE:utf8cpp>)` & requires `PRIVATE utf8cpp::utf8cpp`. However, that doesn't work with a git-cloned copy nor with distro-packaged 3.2.x as those still requires `PRIVATE $<BUILD_INTERFACE:utf8cpp>`. Therefore make the argument depend on availability of the `utf8cpp::utf8cpp` target: it is available only for distro-packaged 4.x.y. For the other two cases (distro-packaged < 4.x.y & cloned from git) we stay with `$<BUILD_INTERFACE:utf8cpp>`. fixes #344 for master
robUx4
approved these changes
Jul 27, 2026
retokromer
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
find_packagewith version constraint3.2.0does not consider 4.x.y to be compatible. Therefore also look for 4.x.y in a secondaryfind_packagecall.The fallback for cloning from git if neither version is found via
cmakeremains in place.Furthermore, linking against a distro-packaged 4.x.y doesn't seem to work with the existing
target_link_libraries(ebml PRIVATE $<BUILD_INTERFACE:utf8cpp>)& requiresPRIVATE utf8cpp::utf8cpp. However, that doesn't work with a git-cloned copy nor with distro-packaged 3.2.x as those still requiresPRIVATE $<BUILD_INTERFACE:utf8cpp>.Therefore make the argument depend on availability of the
utf8cpp::utf8cpptarget: it is available only for distro-packaged 4.x.y. For the other two cases (distro-packaged < 4.x.y & cloned from git) we stay with$<BUILD_INTERFACE:utf8cpp>.fixes #344 for master