1

I installed ROS in my computer. And ROS automatically installed opencv 3.2 in my computer. As I need to use functions in opencv's extra modules, I installed opencv again from source.

Now I have a c++ project and I want to use the opencv I installed from source instead of the one that comes with ROS. As both are 3.2 version, I don't know how to select which opencv to use in CMakeLists.txt.

tczj
  • 438
  • 4
  • 17

1 Answers1

3

You can indicate where to search for packages by changing parameters to find_package(), for example:

find_package(OpenCV 3.2 QUIET NO_DEFAULT_PATH PATHS "/path/to/custom/opencv")

In this case, CMake will not search for OpenCV in usual locations but will search only in the path you specified.

Antonio
  • 19,451
  • 13
  • 99
  • 197
piwi
  • 5,136
  • 2
  • 24
  • 48