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 , 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 or a command line like in is there a easier way?

add_custom_target (my_pkg_doc 
  rosdoc_lite -o ${CATKIN_DEVEL_PREFIX}/lib/my_pkg/doc 
edit retag flag offensive close merge delete


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