So I had a repository that compiled before but couldn't find an executable. I uploaded this to my Drive and have now re-downloaded and it granted permissions so it still has the right dependencies and such.
In CMakeLists.txt :
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs sensor_msgs> ``
image_transport cv_bridge ) find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(my_awesome_library ${OpenCV_LIBRARIES})
And in package.xml:
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>opencv2/highgui/highgui.hpp><build_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<build_export_depend>sensor_msgs</build_export_depend>
<build_export_depend>cv_bridge</build_export_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>image_transport</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>opencv2/highgui/highgui.hpp<exec_depend>
I then ran:
devel/setup.bash
Followed by:
rosdep install --from-paths /home/phil/catkin_ws/src --ignore-src
This worked fine but then I still get the errors:
-- +++ processing catkin package: 'camera'
-- ==> add_subdirectory(camera)
-- Could NOT find vision_opencv (missing: vision_opencv_DIR)
-- Could not find the required component 'vision_opencv'. The following CMake error indicates that you either need to install
the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "vision_opencv"
with any of the following names:
vision_opencvConfig.cmake
vision_opencv-config.cmake
Add the installation prefix of "vision_opencv" to CMAKE_PREFIX_PATH or set
"vision_opencv_DIR" to a directory containing one of the above files. If
"vision_opencv" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
camera/CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/phil/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/phil/catkin_ws/build/CMakeFiles/CMakeError.log".
Base path: /home/phil/catkin_ws
Source space: /home/phil/catkin_ws/src
Build space: /home/phil/catkin_ws/build
Devel space: /home/phil/catkin_ws/devel
Install space: /home/phil/catkin_ws/install
####
#### Running command: "cmake /home/phil/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/phil/catkin_ws/devel-
DCMAKE_INSTALL_PREFIX=/home/phil/catkin_ws/install -G Unix Makefiles" in "/home/phil/catkin_ws/build"
####
Invoking "cmake" failed
This is my repository: https://github.com/MightyFunkster/Cam...
It sort of seems like I've not installed OpenCV correctly but it compiled completely fine with the same repository before I uploaded it :(
I'm using Apache NetBeans, OpenCV 2 and Ubuntu 18.04.4 LTS. It seems strange that it can't find opencv_vision.