Ask Your Question
0

Ament_cmake BUILD_TESTING on by default?

asked 2019-08-02 14:54:59 -0500

DanRose gravatar image

I found it surprising that find_package(ament_cmake REQUIRED) turns BUILD_TESTING on. Is this on purpose? Why? Does this go against the ROS2 principle of "if I don't use a feature, I shouldn't pay for it"?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-08-02 16:00:20 -0500

sloretz gravatar image

ament_cmake exports a dependency on ament_cmake_test which adds the option BUILD_TESTING. This matches the CTest module which "automatically creates a BUILD_TESTING option that selects whether to enable testing support (ON by default)".

If ament_cmake_test isn't required, then calling find_package() on the individual ament_cmake_* packages needed by a project is the way to go. If ament_cmake_test is needed, the BUILD_TESTING option can be turned off on the command line with the cmake argument -DBUILD_TESTING=OFF. If you're using colcon, use colcon build --cmake-args -DBUILD_TESTING=OFF.

edit flag offensive delete link more

Comments

Thanks, @sloretz! It explains a lot that this is an inherited convention :-).

DanRose gravatar imageDanRose ( 2019-08-02 16:32:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-08-02 14:54:59 -0500

Seen: 17 times

Last updated: Aug 02