Skip to content

Can't rely on jsoncpp providing cmake configs #1908

@mizvekov

Description

@mizvekov

jsoncpp has deprecated cmake build system in favor of meson. Distros / packages are switching over, and so the cmake config cannot be relied anymore. This is a problem on Homebrew for instance.

The pkgconfig is generated in both build systems, and so we can switch over, or at least add it as a fallback, but preferably the former for simplicity.

Something like this works:

find_package(PkgConfig REQUIRED)
pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
add_library(jsoncpp_static ALIAS PkgConfig::jsoncpp) # Or preferably don't create the alias and use the imported target directly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions