-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
includedir in pkgconfig is error if install_headers() has subdir argument. #3284
Comments
Is this related to #3248? |
This seems to be incorrect, because as per the documentation at https://github.com/nlohmann/json#integration you should be using: #include <nlohmann/json.hpp> and as such, it is correct to install it to an "nlohmann/" subdirectory but not add that to the include paths. Conversely, you appear to instead be using: #include <json.hpp> Which is a bad idea for several reasons -- scoping, particularly, because it's hardly as though "json.hpp" is an uncommon header name. And indeed, if you use this then it will not be found in If you use the cmake config files instead of the pkg-config files, you will still get |
@eli-schwartz is correct. It is expected that |
Anything to do here? |
@eli-schwartz is correct. We should code as below: |
meson.build has below code:
install_headers('single_include/nlohmann/json.hpp', subdir: 'nlohmann')
It install header file into subdir, such as
~/.local/nlohmann
but pkgconfig file nlohmann_json.pc has below code:
includedir=${prefix}/include
It should be:
includedir=${prefix}/include/nlohmann
You can fix this bug by installing header without subdir:
install_headers('single_include/nlohmann/json.hpp')
Otherwise you can change pkgconfig file nlohmann_json.pc, but I don't know how to do that.
The text was updated successfully, but these errors were encountered: