From b8ddde3650ac9543aecc0f8cc7426a7c5dedfb3d Mon Sep 17 00:00:00 2001 From: Junya Hayashi Date: Tue, 23 Oct 2018 05:03:10 +0000 Subject: [PATCH] use opencv3_catkin explicitly --- cv_bridge/CMakeLists.txt | 14 +++----------- cv_bridge/src/CMakeLists.txt | 4 ---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt index 2f39ddcdd..195f5181b 100644 --- a/cv_bridge/CMakeLists.txt +++ b/cv_bridge/CMakeLists.txt @@ -7,7 +7,7 @@ else() set(CMAKE_CXX_STANDARD 11) endif() -find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs) +find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs opencv3_catkin) if(NOT ANDROID) find_package(PythonLibs) @@ -19,25 +19,17 @@ if(NOT ANDROID) else() find_package(Boost REQUIRED) endif() -find_package(OpenCV 3 REQUIRED - COMPONENTS - opencv_core - opencv_imgproc - opencv_imgcodecs - CONFIG -) catkin_package( INCLUDE_DIRS include LIBRARIES ${PROJECT_NAME} - CATKIN_DEPENDS rosconsole sensor_msgs - DEPENDS OpenCV + CATKIN_DEPENDS rosconsole sensor_msgs opencv3_catkin CFG_EXTRAS cv_bridge-extras.cmake ) catkin_python_setup() -include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) +include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) if(NOT ANDROID) add_subdirectory(python) diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt index 37ba30eea..5091f478b 100644 --- a/cv_bridge/src/CMakeLists.txt +++ b/cv_bridge/src/CMakeLists.txt @@ -32,11 +32,7 @@ if (PYTHON_VERSION_MAJOR VERSION_EQUAL 3) add_definitions(-DPYTHON3) endif() -if (OpenCV_VERSION_MAJOR VERSION_EQUAL 3) add_library(${PROJECT_NAME}_boost module.cpp module_opencv3.cpp) -else() -add_library(${PROJECT_NAME}_boost module.cpp module_opencv2.cpp) -endif() target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES} ${catkin_LIBRARIES} ${PYTHON_LIBRARIES}