Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

dcbaker
Copy link

@dcbaker dcbaker commented Sep 11, 2024

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.

  • Changes are described in the pull request, or an existing issue is referenced.
  • The test suite compiles and runs without error.
  • Code coverage](https://coveralls.io/github/nlohmann/json) is 100%. Test cases can be added by editing the test suite.
  • 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.

And use @ replacement instead of {}, since ${} is significant in
pkg-config's format
This is more standard, and has some advantages when cross compiling.
This also means that the pkg-config files generated by Meson and CMake
now match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant