eli-schwartz commented on PR #3477:
URL: https://github.com/apache/avro/pull/3477#issuecomment-3250166165
For parity with `avro-c` which in stable releases already installs a file
named `avro-c.pc` I would actually recommend:
- create and install `avro-cpp.pc` (pkgconfig file)
- create and install a CMake package config file which can be found via
`find_package(avro-cpp)` -- note that CMake is case sensitive
- bonus: for avro-c, you may want to ship a CMake package config file
compatible with `find_package(avro-c)`
Please note in all cases that when providing the same package configs in
CMake format as well as in standalone agnostic pkg-config format, the lookup
name for `pkg-config --cflags --libs ${name}` and the CMake function
`find_package( ${name} )` should always use the same `${name}` for both. This
is necessary so that build systems which know how to scan for dependencies
using multiple types of "finder", can find either one. It is a big problem with
`find_package()` that it doesn't unify searching across pkgconfig and CMake
configs, so you need to use ifelse ladders to correctly find dependencies
across versions and in the presence of unofficial CMake ports for autotools
dependencies. Most people forget those ifelse ladders. But they aren't needed
with the Meson Build System, because Meson's `dependency('foobar')` function
will try both `pkg-config --cflags --libs foobar` and CMake
`find_package(foobar)`, and things will simply *work* out of the box as long as
the name for both is t
he same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]