
In the CMAKE lists txt file you can specify the version your package should use.
In find_package() command specify the version you need:
find_package(OpenCV 4.2.0 REQUIRED)
Originally posted by prefpkg21 with karma: 61 on 2020-02-20
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by jahim44229 on 2020-02-20:
Normally this was the case;
set(OpenCV_DIR /usr/local/lib/cmake/opencv4)
find_package(catkin REQUIRED COMPONENTS
rospy
roscpp
OpenCV
message_filters
)
When I type OpenCV 4.2.0 , I get an error.(catkin_make error)
Comment by prefpkg21 on 2020-02-20:
add a separate find_package() underneath not as a COMPONENT. Makesure your cmake modules path is set
Comment by jahim44229 on 2020-02-25:
Like this ?
set(OpenCV_DIR /usr/local/lib/cmake/opencv4)
find_package(catkin REQUIRED COMPONENTS
cv_bridge
message_filters
roscpp
rospy
sensor_msgs
std_msgs
)
find_package(OpenCV 4.2.0 REQUIRED)
Comment by jahim44229 on 2020-02-27:
I get the same warning again.
Comment by jahim44229 on 2020-02-27:
How Ros finds OpenCV 3.2. I didn't even write it in the CMakeList.
Comment by wgengland on 2020-03-24:
I' wondering this too.. but in windows!
Comment by Spyros on 2021-03-08:
@jahim44229 I'm facing now the same warning. I'm using opencv 4.5.1 but I found out that cv_bridge recommended version for ros melodic is the 3.2. Check here. Maybe that is why ROS finds 3.2 directly. I'm trying to make my node work fully with 3.2