nxxm / nxxm

The nxxm releases are hosted here.
Other
19 stars 3 forks source link

Not able to depend on nlohman_json. #7

Closed ArthurSonzogni closed 5 years ago

ArthurSonzogni commented 5 years ago

Not sure if this is an issue, but I tried different way to depend on nlohman_json. I started first by what is written in the nxxm doc, then more creative idea:

nlohmann_json

{
  "platform": [ "nlohmann_json" ]
}

Then

● [err] Dynamic exception type: std::runtime_error
std::exception::what: platform_deps : nlohmann_json is incorrect, should be formatted as <pkg>::<component> or <pkg>::+<component> .

nlohmann-json::nlohmann-json

{
  "platform" : [ "nlohmann-json::nlohmann-json"]
}

then:

⏳ ● [err] configuring.  }
-- [polly] Used toolchain: clang / c++17 support
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/sonzogna/.hunter
-- [hunter] [ Hunter-ID: 2d89a86 | Toolchain-ID: 3d458ad | Config-ID: 77549b7 ]
-- Configuring incomplete, errors occurred!
See also "/home/sonzogna/programmation/real/json-ui/build/clang-cxx17/bin/CMakeFiles/CMakeOutput.log".
See also "/home/sonzogna/programmation/real/json-ui/build/clang-cxx17/bin/CMakeFiles/CMakeError.log".

[hunter ** INTERNAL **] Unexpected empty string
[hunter ** INTERNAL **] [Directory:/home/sonzogna/programmation/real/json-ui/build/recipe]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.internal
-------------------------------------------------------------------

CMake Error at /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_wiki)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_assert_not_empty_string.cmake:9 (hunter_internal_error)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_get_package_sha1.cmake:26 (hunter_assert_not_empty_string)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_download.cmake:82 (hunter_get_package_sha1)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_add_package.cmake:53 (hunter_download)
  CMakeLists.txt:40 (hunter_add_package)

● [err] Dynamic exception type: std::runtime_error
std::exception::what: configure failed in /home/sonzogna/programmation/real/json-ui/build/clang-cxx17/bin

nlohmann_json::nlohmann_json

{
  "platform" : [ "nlohmann_json::nlohmann_json"]
}

then:

-- [polly] Used toolchain: clang / c++17 support
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/sonzogna/.hunter
-- [hunter] [ Hunter-ID: 2d89a86 | Toolchain-ID: 3d458ad | Config-ID: 77549b7 ]
-- Configuring incomplete, errors occurred!
See also "/home/sonzogna/programmation/real/json-ui/build/clang-cxx17/bin/CMakeFiles/CMakeOutput.log".
See also "/home/sonzogna/programmation/real/json-ui/build/clang-cxx17/bin/CMakeFiles/CMakeError.log".

[hunter ** INTERNAL **] Component 'nlohmann_json' not found in project 'nlohmann_json'
[hunter ** INTERNAL **] [Directory:/home/sonzogna/programmation/real/json-ui/build/recipe]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.internal
-------------------------------------------------------------------

CMake Error at /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_wiki)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_get_project_files_to_load.cmake:48 (hunter_internal_error)
  /home/sonzogna/.hunter/_Base/Download/Hunter/0.0.3/2d89a86/Unpacked/cmake/modules/hunter_add_package.cmake:39 (hunter_get_project_files_to_load)
  CMakeLists.txt:40 (hunter_add_package)

nlohman_json::+nlohmann_json

{
  "platform": [ "nlohmann_json::+nlohmann_json" ]
}

Then

/home/sonzogna/programmation/real/json-ui/main.cpp:2:10: fatal error: 'nlohman/json.hpp' file not found
#include <nlohman/json.hpp>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
daminetreg commented 5 years ago

As nlohmann json is hosted on github, I would advice you to use it definitely via the Github dependency retrieval method :

In your .nxxm/deps file

{
  "nlohmann/json" : { "@" : "v3.1.2", "x" : ["benchmarks"] }
}
daminetreg commented 5 years ago

Dear @ArthurSonzogni,

As discussed on the gitter chat, you could solve this issue with both :

{
  "platform" : [ "nlohmann_json::+nlohmann_json" ]
}

and

{
  "nlohmann/json" : { "@" : "v3.1.2", "x" : ["benchmarks"] }
}

Therefore I'll close it. The documentation has been updated here : https://github.com/nxxm/nxxm-docs/commit/ebfb4dc9d40390d2e28283b0b97abce5c02f198b