# Own message generator and building tests

**URL:** <https://discourse.openrobotics.org/t/own-message-generator-and-building-tests/796>\
**Category:** ROS General\
**Created:** [November 7, 2016, 6:51pm UTC](https://discourse.openrobotics.org/t/own-message-generator-and-building-tests/796 "2016-11-07T18:51:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![firesurfer](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/firesurfer/32/11626_2.png) [@firesurfer](https://discourse.openrobotics.org/u/firesurfer)\
**Post date:** [November 8, 2016, 11:22am UTC](https://discourse.openrobotics.org/t/own-message-generator-and-building-tests/796/3 "2016-11-08T11:22:11Z")

</div>

Thanks a lot. Sometimes it’s hard to see the most obvious things. ` add_dependencies()` has by the way the same problem as the `DEPENDS` statement.  
I had to use this rather ugly solution:

```
 if(${PROJECT_NAME} STREQUAL "rosidl_generator_cs")
   add_dependencies(${MSG_TARGET_NAME} ros2cs_message_generator)
 endif()

```

---

_[View the full topic](https://discourse.openrobotics.org/t/own-message-generator-and-building-tests/796)._
