How do I build sphinx docs from catkin_make in hydro?

asked 2014-04-10 14:03:24 -0500

lucasw gravatar image

updated 2020-11-21 11:36:54 -0500

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... or a command line like in http://answers.ros.org/question/57078... 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}
)
edit retag flag offensive close merge delete

Comments

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

William gravatar image William  ( 2014-04-21 07:47:45 -0500 )edit

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

lucasw gravatar image lucasw  ( 2014-06-09 16:13:06 -0500 )edit
1

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.

Dirk Thomas gravatar image Dirk Thomas  ( 2014-06-09 16:31:30 -0500 )edit