From 69174447fef810e26f24747760bfc1ae9569ffdc Mon Sep 17 00:00:00 2001 From: Anton David Guaman Davila Date: Sat, 13 Jan 2024 12:43:21 -0330 Subject: [PATCH] Updated CMakeList to find the JSONCpp library --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfec416..96df4a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,8 +19,8 @@ find_package(catkin REQUIRED COMPONENTS find_package(OpenCV REQUIRED) - - +find_package(PkgConfig REQUIRED) +pkg_check_modules(JSONCPP jsoncpp) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) @@ -127,6 +127,7 @@ include_directories( include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} + ${JSONCPP_INCLUDE_DIRS} ) # Declare a C++ library @@ -144,7 +145,11 @@ add_library(DetectedObjectLib ## With catkin_make all packages are built within a single CMake context ## The recommended prefix ensures that target names across packages don't collide add_executable(object_detection src/object_detection.cpp) -target_link_libraries(object_detection ${catkin_LIBRARIES}) +target_link_libraries(object_detection + ${catkin_LIBRARIES} + ${OpenCV_LIBRARIES} + ${JSONCPP_LIBRARIES} +) add_dependencies(object_detection ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})