catkin_add_gtest usage
Hello everyone, turtlebot-description package has a CMakeLists as below:
cmake_minimum_required(VERSION 2.8.3)
project(turtlebot_description)
find_package(catkin REQUIRED COMPONENTS urdf xacro)
catkin_package(
CATKIN_DEPENDS urdf xacro
)
install(DIRECTORY robots
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY meshes
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY test
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
catkin_add_gtest(${PROJECT_NAME}_test_urdf test/test_urdf.cpp)
During the build, I get an error message as below:
| CMake Error at /media/Build/next/build/tmp/sysroots/duovero/usr/share/catkin/cmake/test/tests.cmake:17 (message):
| catkin_add_gtest() is not available when tests are not enabled. The CMake
| code should only use it inside a conditional block which checks that
| testing is enabled:
|
| if(CATKIN_ENABLE_TESTING)
|
| catkin_add_gtest(...)
|
| endif()
It's obvious that the unit test should be only called when testing is enabled. However, the last commit on this code was 7 months ago. I am sure some would have caught the error by now. So I began looking for the correct use case for this macro, and the ROS doc doesn't mention much about it. Can someone verify that it indeed needs to check whether testing is enabled?