ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In CMake, the find_package() command is used to make information about other packages available to your build process.

By convention, most packages provide pacakge_INCLUDE_DIRS, package_LIBRARIES, and usually a few other variables.

So, if you want to use OpenCV and the OpenCV_INCLUDE_DIRS and OpenCV_LIBRARIES variables in your project, you need to do:

 find_package(OpenCV REQUIRED)

(And yes, cmake is slightly crazy for having a function which creates variables as a side-effect)

In CMake, the find_package() command is used to make information about other packages available to your build process.

By convention, most packages provide pacakge_INCLUDE_DIRS, package_LIBRARIES, and usually a few other variables.

So, if you want to use OpenCV and the OpenCV_INCLUDE_DIRS and OpenCV_LIBRARIES variables in your project, you need to do:

 find_package(OpenCV REQUIRED)

(And yes, cmake is slightly crazy for having a function which creates variables as a side-effect)

UPDATE:

The example and your sample both use braces for the variable name: ${OpenCV_LIBRARIES} (correct), but the error message you posted uses parentheses: $(OpenCV_LIBRARIES) (incorrect). Is it possible that this is typo in a part of your CMakeLists.txt that you didn't post?