From a222dcdbdc6d824e41f1798a4bb602e494a512af Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Tue, 11 Apr 2017 01:29:10 +0900 Subject: [PATCH] to avoid problems like http://answers.ros.org/question/245451/process-dies-upon-opencv_apps-hough_circleslaunch/ --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4d309c0..a79a3044 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,10 +3,10 @@ project(opencv_apps) find_package(catkin REQUIRED COMPONENTS cv_bridge dynamic_reconfigure message_generation image_transport nodelet roscpp) -find_package(OpenCV REQUIRED) message(STATUS "OpenCV VERSION: ${OpenCV_VERSION}") message(STATUS "OpenCV Components: ${OpenCV_LIB_COMPONENTS}") -if(OpenCV_VERSION VERSION_LESS "3.0" OR TARGET opencv_optflow) +list(FIND OpenCV_LIB_COMPONENTS opencv_optflow2 find_opencv_optflow) +if(OpenCV_VERSION VERSION_LESS "3.0" OR find_opencv_optflow GREATER -1) set(OPENCV_HAVE_OPTFLOW TRUE) endif() # Supporting CompressedImage in cv_bridge has been started from 1.11.9 (2015-11-29)