Robotics StackExchange | Archived questions

How do I build sphinx docs from catkin_make in hydro?

I've added a sphinx docs directory according to http://wiki.ros.org/Sphinx, and I can run rosdoc_lite . from the package directory and the documentation builds fine. I can also run make html or make latexpdf from within the doc folder.

But how do I get catkin_make to do it for me, and put the results in the the build dir rather than in the catkin src tree? I'd like it to build both html and pdf.

Do I have to do something as extensive as http://ericscottbarr.com/blog/2012/03/sphinx-and-cmake-beautiful-documentation-for-c-projects/ or a command line like in http://answers.ros.org/question/57078/rosdoc_lite-and-raw-messages-in-generated-documentaion/ is there a easier way?

add_custom_target (my_pkg_doc 
  rosdoc_lite -o ${CATKIN_DEVEL_PREFIX}/lib/my_pkg/doc 
  ${CMAKE_CURRENT_LIST_DIR}
)

Asked by lucasw on 2014-04-10 14:03:24 UTC

Comments

The custom target approach seems like the best way to do this. Does the above CMake snippet not work for you?

Asked by William on 2014-04-21 07:47:45 UTC

The target works but I haven't gotten it to only run when the rst files changes, so I don't have it run at all outside of explicitly running catkin_make my_pkg_doc.

The other problem is that I don't know how to get rosdoc_list to produce a pdf (as does running make latexpdf in the doc directory).

Asked by lucasw on 2014-06-09 16:13:06 UTC

http://cmake.org/cmake/help/v2.8.12/cmake.html#command:add_custom_target The target has no output file and is ALWAYS CONSIDERED OUT OF DATE even if the commands try to create a file with the name of the target. Use add_custom_command instead.

Asked by Dirk Thomas on 2014-06-09 16:31:30 UTC

Answers