We've decided to have a consistent approach to static library naming and provision of .cmake and .pc files across both the C Driver and mongocxx.
A summary of the approach is here:
- Naming convention: For library 'foo', static libraries will be always named 'foo-static' (or that such a name will exist as symlink) on all operating systems with an OS-specific suffix (e.g. ".a" or ".lib")
- Install both 'libfoo' and 'libfoo-static' pkg-config '.pc' files on all operating systems
- Install both 'libfoo-config' and 'libfoo-static-config' CMake '.cmake' files on all operating systems
- Static '.pc' and '.cmake' will not be installed if the static library is not built
- 'libfoo.pc' (dynamic) config files will list in 'Requires' only those dynamic dependencies that must have cflags and libraries expanded for applications to compile/link successfully (i.e. to find all headers and avoid unresolved reference errors). It will not list deep dependencies in 'Requires'. It will not have 'Requires.private'. It will not add any appropriate "FOO_STATIC" defines to cflags.
- 'libfoo-static.pc' config files will list all deep dependencies (whether dynamic or static) in 'Requires'. It will not have 'Requires.private'. It will add any appropriate "FOO_STATIC" defines to cflags.
- Cmake '.cmake' files will follow similar conventions as the '.pc' files.