json icon indicating copy to clipboard operation
json copied to clipboard

CMake: generate a pkg-config file that follow pkg-config conventions

Open dcbaker opened this issue 1 year ago • 0 comments

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/nlohmann directory, run make amalgamate to create the single-header files single_include/nlohmann/json.hpp and single_include/nlohmann/json_fwd.hpp. The whole process is described here.

dcbaker avatar Sep 11 '24 16:09 dcbaker