ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Automated rosdoc_lite execution

asked 2015-02-17 07:08:37 -0500

Georacer gravatar image

Hello everyone,

I was wondering whether it is possible to run rosdoc_lite automatically with every catkin_make for my packages, so that supporting documentation is always up-to-date.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-02-19 13:22:01 -0500

Georacer gravatar image

updated 2015-06-25 03:03:50 -0500

Finally got it! I don't know why it works, but it does.

    add_dependencies(environment ${PROJECT_NAME}_generate_messages_cpp ROSLITE_HOOK)
## Generate Doxygen files
    add_custom_command(OUTPUT rosdoc_output
        COMMAND rosdoc_lite $(rospack find last_letter) -o $(rospack find last_letter)/doc
    add_custom_target(ROSLITE_HOOK DEPENDS rosdoc_output)

EDIT: In the end, I did it in the following way. The previous didn't work as expected:

## Generate package documentation with rosdoc_lite
execute_process(COMMAND rospack find last_letter
execute_process(COMMAND rosdoc_lite -o ${LAST_LETTER_DIR}/doc/doxygen_rosdoc_lite ${LAST_LETTER_DIR} )
edit flag offensive delete link more


Defining the dependency is what I was trying to explain. Sorry I didn't know enough to fill in the details. Glad you got it working.

joq gravatar image joq  ( 2015-02-19 13:56:23 -0500 )edit

answered 2015-02-17 11:10:48 -0500

joq gravatar image

updated 2015-02-17 13:02:51 -0500

I have not tried that, myself. But, you can add custom CMake commands to your CMakeLists.txt.

Take a look at add_custom_command() and add_custom_target().

EDIT: I think you need to define a CMake target, but I am not a CMake expert. Something has to depend on your documentation target to cause building it.

You might take a look at how roslint defines its custom commands and targets:

edit flag offensive delete link more


I tried placing this

## Generate doxygen documenation files
add_custom_command(OUTPUT tempdoc.txt
    COMMAND touch tempdoc.txt

In my package's CMakeLists just before the Install header but nothing came out. Ideas?

Georacer gravatar image Georacer  ( 2015-02-17 11:55:59 -0500 )edit

After doing further internet searching, I can't find why the OUTPUT syntax of add_custom_command shouldn't work on its own (ie regardless of dependencies). I'm pretty stumped on this one.

Georacer gravatar image Georacer  ( 2015-02-19 12:22:55 -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


Asked: 2015-02-17 07:08:37 -0500

Seen: 292 times

Last updated: Jun 25 '15