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()