Skip to content

Commit

Permalink
Merge pull request #3055 from traversaro/cleanupopencv
Browse files Browse the repository at this point in the history
CMake: Use OpenCV_LIBS instead of OpenCV_LIBRARIES as documented in official OpenCV docs
  • Loading branch information
randaz81 authored Nov 29, 2023
2 parents cc2a18b + 12cd6e0 commit eb4243a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion example/cmake/with_opencv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ find_package(OpenCV REQUIRED)
# add OpenCV include directories
target_include_directories(foo PRIVATE ${OPENCV_INCLUDE_DIR})
# link OpenCV libraries
target_link_libraries(foo PRIVATE ${OPENCV_LIBRARIES}
target_link_libraries(foo PRIVATE ${OpenCV_LIBS}
2 changes: 1 addition & 1 deletion example/opencv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ find_package(OpenCV REQUIRED)

add_executable(opencv_test)
target_sources(opencv_test PRIVATE main.cpp)
target_link_libraries(opencv_test PRIVATE ${YARP_LIBRARIES} ${OpenCV_LIBRARIES})
target_link_libraries(opencv_test PRIVATE ${YARP_LIBRARIES} ${OpenCV_LIBS})
2 changes: 1 addition & 1 deletion src/devices/opencv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(NOT SKIP_opencv_grabber)
)

target_include_directories(yarp_opencv SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(yarp_opencv PRIVATE ${OpenCV_LIBRARIES})
target_link_libraries(yarp_opencv PRIVATE ${OpenCV_LIBS})
# list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS OpenCV) (not using targets)

yarp_install(
Expand Down
2 changes: 1 addition & 1 deletion src/devices/usbCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(ENABLE_usbCamera OR ENABLE_usbCameraRaw)
# list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS Libv4lconvert) (not using targets)

target_include_directories(yarp_usbCamera SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(yarp_usbCamera PRIVATE ${OpenCV_LIBRARIES})
target_link_libraries(yarp_usbCamera PRIVATE ${OpenCV_LIBS})
# list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS OpenCV) (not using targets)

yarp_install(
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_cv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

project(YARP_cv)

# OpenCV is required, otherwise the OpenCV_INCLUDE_DIR and OpenCV_LIBRARIES
# OpenCV is required, otherwise the OpenCV_INCLUDE_DIR and OpenCV_LIBS
# (used in the CMakeLists.txt file in the src direcrory) are not expanded).
# FIXME Remove this check when OpenCV targets will be used.
if (NOT YARP_HAS_OpenCV)
Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_cv/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ target_link_libraries(YARP_cv INTERFACE YARP::YARP_sig)
list(APPEND YARP_cv_PUBLIC_DEPS YARP_sig)

target_include_directories(YARP_cv SYSTEM INTERFACE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(YARP_cv INTERFACE ${OpenCV_LIBRARIES})
target_link_libraries(YARP_cv INTERFACE ${OpenCV_LIBS})
list(APPEND YARP_cv_PUBLIC_DEPS OpenCV)

# set_property(TARGET YARP_cv PROPERTY PUBLIC_HEADER ${YARP_cv_HDRS})
Expand Down
2 changes: 1 addition & 1 deletion src/portmonitors/image_rotation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS
)

target_include_directories(yarp_pm_image_rotation SYSTEM PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(yarp_pm_image_rotation PRIVATE ${OpenCV_LIBRARIES})
target_link_libraries(yarp_pm_image_rotation PRIVATE ${OpenCV_LIBS})

yarp_install(
TARGETS yarp_pm_image_rotation
Expand Down
2 changes: 1 addition & 1 deletion src/yarpdatadumper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(YARP_COMPILE_yarpdatadumper)

if(YARP_HAS_OpenCV)
target_compile_definitions(yarpdatadumper PRIVATE ADD_VIDEO)
target_link_libraries(yarpdatadumper PRIVATE ${OpenCV_LIBRARIES})
target_link_libraries(yarpdatadumper PRIVATE ${OpenCV_LIBS})
target_link_libraries(yarpdatadumper PRIVATE YARP::YARP_cv)
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/yarpdataplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if(YARP_COMPILE_yarpdataplayer)
target_include_directories(yarpdataplayer PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(yarpdataplayer
PRIVATE
${OpenCV_LIBRARIES}
${OpenCV_LIBS}
YARP::YARP_cv
)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/yarplaserscannergui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if(YARP_COMPILE_yarplaserscannergui)
)

target_include_directories(yarplaserscannergui PRIVATE ${OpenCV_INCLUDE_DIRS})
target_link_libraries(yarplaserscannergui PRIVATE ${OpenCV_LIBRARIES})
target_link_libraries(yarplaserscannergui PRIVATE ${OpenCV_LIBS})

install(TARGETS yarplaserscannergui COMPONENT utilities DESTINATION ${CMAKE_INSTALL_BINDIR})

Expand Down

0 comments on commit eb4243a

Please sign in to comment.