[ros-users] [Discourse.ros.org] [Next Generation ROS] Own message generator and building tests

dhood ros.discourse at gmail.com
Tue Nov 8 03:54:32 UTC 2016




When you build with `--build-tests`, the `BUILD_TESTING` cmake option is set to true.

>From looking at your project, I think you are only appending the target to the list of message targets if `BUILD_TESTING` is true:
https://github.com/firesurfer/rosidl_generator_cs/blob/d1bcce9588b0b886355b087e80ae8f48ec976e80/cmake/rosidl_generator_cs_generate_interfaces.cmake#L30

That might explain why it's only failing when you build with `--build-testing`

As for why it's failing, [the documentation for `add_custom_target`](https://cmake.org/cmake/help/v3.5/command/add_custom_target.html) says that `add_dependencies()` should be used instead of `DEPENDS` if you're looking to add a dependency on another target, which looks to be your case with `ros2cs_message_generator` - not sure if that helps






---
[Visit Topic](http://discourse.ros.org/t/own-message-generator-and-building-tests/796/2) or reply to this email to respond.




More information about the ros-users mailing list