ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

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.

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

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
    OUTPUT_VARIABLE LAST_LETTER_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND rosdoc_lite -o ${LAST_LETTER_DIR}/doc/doxygen_rosdoc_lite ${LAST_LETTER_DIR} )
edit flag offensive delete link more

Comments

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
2

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

Comments

I tried placing this

## Generate doxygen documenation files
add_custom_command(OUTPUT tempdoc.txt
    COMMAND touch tempdoc.txt
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    )

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

Question Tools

Stats

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

Seen: 321 times

Last updated: Jun 25 '15