json
json copied to clipboard
CMake: generate a pkg-config file that follow pkg-config conventions
The pkg-config file generated by Meson matches the convention of using a prefix variable, and an includedir variable that is relative to prefix (includedir=${prefix}/include). The one generated by CMake does not do this, but hard codes the include directory straight into the Cflags field. There are advantages to having the prefix (thus the convention)`, especially when cross compiling.
This PR makes the CMake generated pkg-config file meat convention, and match the one generated by Meson.
Pull request checklist
Read the Contribution Guidelines for detailed information.
- [x] Changes are described in the pull request, or an existing issue is referenced.
- [x] The test suite compiles and runs without error.
- [x] Code coverage](https://coveralls.io/github/nlohmann/json) is 100%. Test cases can be added by editing the test suite.
- [x] The source code is amalgamated; that is, after making changes to the sources in the
include/nlohmanndirectory, runmake amalgamateto create the single-header filessingle_include/nlohmann/json.hppandsingle_include/nlohmann/json_fwd.hpp. The whole process is described here.