0
$\begingroup$

Rosanswers logo

I followed this guide http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/ for setting up OpenCV for ROS Indigo (since it doesn't come bundled anymore).

Now, the problem is I don't have an executable node that is produced from a CPP source file for target_link_libraries but I have a python node that uses OpenCV.

After adding 1)

all the dependencies in "package.xml" file,

and 2)

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(${OpenCV_LIBS})

in the CMakeLists.txt file, I get this error:

CMake Error at HELLO_WORLD/CMakeLists.txt:168 (target_link_libraries):
  Cannot specify link libraries for target "HELLO_WORLD" which is not built
  by this project.

How do I resolve this issue? Other nodes written in Python, I can just say "rosrun [PACKAGE_NAME] python_node.py" But in this Python node that uses OpenCV, I need to make changes appropriately in the CMakeLists.txt file. Only, I'm not quite sure what it is. sources I've referred to talk about CPP nodes.


Originally posted by voladoddi on ROS Answers with karma: 87 on 2015-04-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you're only using OpenCV with python, you don't need to add anything in your CMakeLists.txt. As long as the python module is on your PYTHONPATH, you're all set.


Originally posted by Dan Lazewatsky with karma: 9115 on 2015-04-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by voladoddi on 2015-04-23:
Thanks! Yes, I realised that "import cv2" already exists in the code. And it was pointed about by another gentleman on another post as well but this makes it clear :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.