You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really excited to start using this library in my project, but running into this issue while trying to build.
I've specified nlohmann_json/3.9.1 in my conanfile, which is found and installed without issue when running conan install. I then have the following snippet in my CMakeLists.txt:
This is the exact same way I pull in Boost in a different project, however when running cmake, conan_basic_setup() runs without issue, which sets CONAN_NLOHMANN_JSON_ROOT, but then the script fails on find_package with the following output:
CMake Error at CMakeLists.txt:30 (find_package):
By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"nlohmann_json", but CMake did not find one.
Could not find a package configuration file provided by "nlohmann_json"
(requested version 3.9.1) with any of the following names:
Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
"nlohmann_json_DIR" to a directory containing one of the above files. If
"nlohmann_json" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Is there some merit to the recommendation in this error? I shouldn't need to change CMAKE_PREFIX_PATH.
Please advise if I am doing something wrong or if there may be a less obvious issue at hand. Thanks!
The text was updated successfully, but these errors were encountered:
Hi there,
Really excited to start using this library in my project, but running into this issue while trying to build.
I've specified nlohmann_json/3.9.1 in my conanfile, which is found and installed without issue when running conan install. I then have the following snippet in my CMakeLists.txt:
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
Set(nlohmann_json_INSTALL_DIR ${CONAN_NLOHMANN_JSON_ROOT})
find_package(nlohmann_json 3.9.1 REQUIRED)
This is the exact same way I pull in Boost in a different project, however when running cmake, conan_basic_setup() runs without issue, which sets CONAN_NLOHMANN_JSON_ROOT, but then the script fails on find_package with the following output:
CMake Error at CMakeLists.txt:30 (find_package):
By not providing "Findnlohmann_json.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"nlohmann_json", but CMake did not find one.
Could not find a package configuration file provided by "nlohmann_json"
(requested version 3.9.1) with any of the following names:
Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set
"nlohmann_json_DIR" to a directory containing one of the above files. If
"nlohmann_json" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Is there some merit to the recommendation in this error? I shouldn't need to change CMAKE_PREFIX_PATH.
Please advise if I am doing something wrong or if there may be a less obvious issue at hand. Thanks!
The text was updated successfully, but these errors were encountered: