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

catkin does find GTest for you and provides the common CMake variables for it:

GTEST_FOUND
GTEST_INCLUDE_DIRS
GTEST_LIBRARIES
GTEST_MAIN_LIBRARIES
GTEST_BOTH_LIBRARIES

But all test related CMake functions (like catkin_add_gtest) will not be available when testing is not enabled.

On the buildfarm when generating debs you can't expect testing to be enabled. Since you want the artifact to be included in the Debian package it must be done outside of the CATKIN_ENABLE_TESTING block.

It is also your responsibility to install the gtest library. Be aware that no downstream package should ever use your packaged version of the gtest library but build it on its own (see gtest docs for more details why). Also you should make sure that your package does not conflict with other packages doing the same - so the library should be named in a way that does not interfere with other code.