-
Dear All, cmake_minimum_required (VERSION 3.5) project(sign) find_package(OpenCV REQUIRED) find_package(nlohmann_json REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(sign_detect.exe sign_detect.cpp) target_link_libraries(sign_detect.exe ${OpenCV_LIBS}) target_link_libraries(sign_detect.exe nlohmann_json::nlohmann_json) The result of this file gives me the below error: Could not find a package configuration file provided by "nlohmann_json"
Add the installation prefix of "nlohmann_json" to CMAKE_PREFIX_PATH or set Any kind of help to solve this problem will be highly appreciated Best Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Maybe related: #2184 I am not maintaining any Ubuntu package, so I am afraid I cannot help. |
Beta Was this translation helpful? Give feedback.
-
I have followed another approach to solve this problem. I have downloaded the latest json.hpp file from the repository and modified my CMakeLists.txt file as follows: cmake_minimum_required (VERSION 3.5) project(sign) find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) include_directories(include) add_executable(sign_detect sign_detect.cpp include/json.hpp) target_link_libraries(sign_detect ${OpenCV_LIBS}) Now the code compilation is okay |
Beta Was this translation helpful? Give feedback.
I have followed another approach to solve this problem. I have downloaded the latest json.hpp file from the repository and modified my CMakeLists.txt file as follows:
cmake_minimum_required (VERSION 3.5)
project(sign)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(include)
add_executable(sign_detect sign_detect.cpp include/json.hpp)
target_link_libraries(sign_detect ${OpenCV_LIBS})
Now the code compilation is okay