-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 target nlohmann_json does not have src into its interface includes #741
Comments
maybe related: #695 |
@sogartar what system do you use? Windows? Mac? Linux? cmake
make
make install If the usage you described is a common one (I did never useed 3rdparty CMake-Projekts like this) |
@sogartar I forgot, a simpler oneliner for your case could be include_directory(nlohmann/json/src) |
Is there anything to be done to close this issue? |
I think you should add nlohmann/json/src to the public includes of the nlohmann_json target. See target_include_directories. |
Well @sogartar thx for answering any of my questions. so IMHO I would ignore it. But I will have a look and see what impact the suggestion would be. |
Does anyone has an idea how to proceed here? |
Issue #790 also proposes to change the include dir. |
Sorry, #790 is unrelated to this issue. |
I need more info on this issue. What needs to be fixed? Is there example code to demonstrate the issue? |
Playing with I'll open a PR tomorrow morning. |
I think there is still some problem in the include directories. I installed the lib with the following commands:
So I got the lib at C:/cmake/include/nlohmann/json.hpp My cmake project is really simple:
The find_package and target_link_libraries commands work well. I'm not so experienced with cmake so I might be doing something wrong, although I have successfully used many other libraries following the same procedure. Any sugestions on how to tackle this? @dan-42 @theodelrieu |
Could you try |
Yes, that solved it! Just added nlohmann_json::nlohmann_json to the target_link_libraries command. Thanks! |
If you do in CMake:
Then
my_target
does not have nlohmann/json/src into its includes, where json.hpp is. You can not properly include this project into other CMake projects.Note that in v2.1.1 it used to be OK.
The text was updated successfully, but these errors were encountered: