diff --git a/CMakeLists.txt b/CMakeLists.txt index be42cfd..fc5ebf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,14 @@ cmake_minimum_required(VERSION 2.8) project(ecto_opencv) +find_package(cv_backports QUIET) +if(cv_backports_FOUND) find_package(catkin REQUIRED ecto opencv_candidate cv_backports) catkin_package(DEPENDS ecto opencv_candidate cv_backports) +else() +find_package(catkin REQUIRED ecto opencv_candidate) +catkin_package(DEPENDS ecto opencv_candidate) +endif() if(NOT CMAKE_BUILD_TYPE)#Only do this the on the first run, if the build type hasn't been set prior set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING diff --git a/cells/cv_bp/opencv/cv_highgui.cpp b/cells/cv_bp/opencv/cv_highgui.cpp index c36d86a..3edb550 100644 --- a/cells/cv_bp/opencv/cv_highgui.cpp +++ b/cells/cv_bp/opencv/cv_highgui.cpp @@ -6,7 +6,18 @@ #include #include #include +#if CV_MAJOR_VERSION == 2 && CV_MINOR_VERSION == 4 && CV_SUBMINOR_VERSION < 10 #include +#else +namespace cv_backports { + using cv::destroyWindow; + using cv::imshow; + using cv::namedWindow; + using cv::setWindowProperty; + using cv::startWindowThread; + using cv::waitKey; +} +#endif namespace bp = boost::python;