-
-
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
Generated nlohmann_jsonConfig.cmake does not set JSON_INCLUDE_DIR #695
Comments
Hi @matthewOConnell can you explain more by what you mean does not set JSON_INCLUDE_DIR? get_target_property(JSON_INCLUDE_DIRS nlohmann_json INTERFACE_INCLUDE_DIRECTORIES) all needed information is exposed to the target by calling ## note the PATHS is only needed because for testing I did not install it in my system!
find_package(nlohmann_json CONFIG REQUIRED PATHS ../install/lib/cmake)
add_executable(main main.cpp)
target_link_libraries(main nlohmann_json) But yes, the refactored CMake does set the include so that the user needs to call I hope that helps. And If it is needed, we can add a CMake-option to use either cheers Daniel |
Sounds like we're just getting down to preference, and probably my lack of understanding on "modern" CMake patterns. This is the first I've run into a I actually agree with changing In general build systems are a giant pain, as shown by the two of us discussing intricacies of CMake style for a header-only tool. But when in doubt I lean towards not violating the law of least astonishment. |
No, thats not down to preferences, there are a lot of good reaons to use Why not to use
|
I have no opinion on this as I do not use Cmake for this and cannot judge which way is better. |
Any opinions on this? |
I agree that using |
I tend to close this issue and #697 and leave the code as is unless I oversaw something. |
Looks like CMake refactoring in f434942 clipped setting
JSON_INCLUDE_DIR
. This breaksfind_package(nlohmann_json)
and finding the correct header location.The text was updated successfully, but these errors were encountered: