Skip to content

fix detecting & using utf8c++ 4.0.0 or newer - #353

Merged
mbunkus merged 1 commit into
masterfrom
fix-cmake-utf8cpp
Jul 28, 2026
Merged

fix detecting & using utf8c++ 4.0.0 or newer#353
mbunkus merged 1 commit into
masterfrom
fix-cmake-utf8cpp

Conversation

@mbunkus

@mbunkus mbunkus commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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

`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
@mbunkus
mbunkus merged commit 928e273 into master Jul 28, 2026
20 checks passed
@mbunkus
mbunkus deleted the fix-cmake-utf8cpp branch July 28, 2026 06:08
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.

Try to link to non-existant utf8cpp library (ebml 1.4.6)

3 participants