Conversation
|
|
||
| add_executable(main main.cpp) | ||
|
|
||
| target_link_libraries(main |
There was a problem hiding this comment.
Should we have target_link_libraries(main nlohmann_json::nlohmann_json) somewhere?
There was a problem hiding this comment.
good catch, i checked and it is now target_link_libraries(main nlohmann_json)
Looks good, just mention in wiki how to migrate and what version has the last |
|
Thx for the review. |
|
Everything seems to be failing: |
|
ohh no sry, my tests worked -,- |
|
Ok I had the old version somehow still in my path and I did not tested the example properly. Also the include changed it's now now runs on my system dan@kay ..it/hunter/examples/nlohmann_json/build (git)-[feature/upgrade_nlohman_json] % rm -rf ./*
zsh: sure you want to delete all 6 files in /home/dan/git/hunter/examples/nlohmann_json/build/. [yn]? y
dan@kay ..it/hunter/examples/nlohmann_json/build (git)-[feature/upgrade_nlohman_json] % cmake ..
Including HunterGate: /home/dan/git/hunter/gate/cmake/HunterGate.cmake
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [hunter] Calculating Config-SHA1
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] HUNTER_ROOT: /home/dan/git/hunter
-- [hunter] [ Hunter-ID: xxxxxxx | Config-ID: b4f8ee8 | Toolchain-ID: 12f1fdb ]
-- [hunter] NLOHMANN_JSON_ROOT: /home/dan/git/hunter/_Base/xxxxxxx/b4f8ee8/12f1fdb/Install (ver.: 2.1.1)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dan/git/hunter/examples/nlohmann_json/build
dan@kay ..it/hunter/examples/nlohmann_json/build (git)-[feature/upgrade_nlohman_json] % make
Scanning dependencies of target main
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
[100%] Built target main
dan@kay ..it/hunter/examples/nlohmann_json/build (git)-[feature/upgrade_nlohman_json] % ./main
{"answer":{"everything":42},"happy":true,"list":[1,0,2],"name":"Niels","nothing":null,"object":{"currency":"USD","value":42.99},"pi":3.141}
dan@kay ..it/hunter/examples/nlohmann_json/build (git)-[feature/upgrade_nlohman_json] %
|
In this case package should be called Please squash everything into one commit. |
|
Ok I can do that, but is that what you want? so as an alternative the include path could be altered by hunter? or would that be to intrusiv? |
It should be fixed in package itself. |
|
Ok so for now we postpone this untill I checked it with the maintainers of nlohman_json. |
|
FYI: |
|
Checking with nlohmann about the include name issue here nlohmann/json#668 stay tuned for updates :-) @v1bri nice I'm not allown by wanting the latest version of this in hunter |
|
@dan-42 Totally, I just started using this useful library myself. What I meant by my comment is I believe nlohmann/json is installing headers to the appropriate location. Here's my system... ... So I'm wondering if your environment shows the same? Also, the testing flag is |
|
@v1bri yes, I have seen/been hit by these changes as well. |
Hmm I'm not sure where you're seeing this? The include destination folder is set to This path is also set in the library's include INTERFACE property. I'm not sure any change is required in the nlohmann/json project. My builds went just fine with Can you elaborate on what you think needs to change in that project? |
It is correct in But it's not correct to use it in Also instead of install(
TARGETS foo
EXPORT "${targets_export_name}"
INCLUDES DESTINATION "include"
) |
|
Thanks for the follow-up. CMake generator expressions are still a little opaque to me. |
|
I've released last updates in fork: Hunter release: |
Dear @ruslo
This PR pushes nlohmanUjson to V2.1.1, currently in hunter is V1.0.0
As they have improved there cmake, the usage breaks.
as
target_link_libraries(main nlohmann-json::nlohmann-json)not needed any moreand find_package calls
nlohman_jsonalso
JSON_BuildTestschanged to camel case.so I allowed me to rename every thing to this new naming scheme and I have abonded two very old versions V1.0.0 as they also have only been release candidates
I'm looking forward with exitment for your comments on this, and if its to much "breaking" changes or not.
Thank you