1

I'm trying to simply run a doxygen dox_er_ros command from cmakeLists.txt file to generate documentation for the project. The dox_er_ros file path is /src/er_ros/ and the cmake file exists in /src/ directory

I've tried using execute_process() and add_custom_command() methods but due to the lack of experience with cmake I don't understand what was I doing wrong.

add_custom_command(
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/er_ros
  COMMAND doxygen dox_er_ros
)

I expect to see some kind of documentation generation when running catkin_make cmd. For now I saw that cmake can't find dox_er_ros or nothing at all.

gabrielQ
  • 11
  • 2
  • Welcome. What kind of error message do you get? Did you do a `find_package(Doxygen)` or set the `DOXYGEN_EXECUTABLE` by hand? Probably the command should be `${DOXYGEN_EXECUTABLE} dox_er_ross` or `COMMAND ${CMAKE_COMMAND} ${DOXYGEN_EXECUTABLE} dox_er_ross` – albert Jul 31 '19 at 07:45
  • I changed the code to: `find_package(Doxygen) execute_process( COMMAND ${CMAKE_COMMAND} ${DOXYGEN_EXECUTABLE} dox_er_ros )` I get the error: `The source directory "/home/vm/repos/erRos_ws/build/dox_er_ros" does not exist.` – gabrielQ Jul 31 '19 at 07:54
  • And the result is? Why execute_process? – albert Jul 31 '19 at 07:56
  • nothing happens after that, I changed it to `execute_process()` because when I use `add_custom_command()` I get the error `add_custom_command Wrong syntax. A TARGET or OUTPUT must be specified.` – gabrielQ Jul 31 '19 at 08:01
  • Maybe you should add the TARGET or the OUTPUT or dive into the possibilities of `add_custom_target` – albert Jul 31 '19 at 08:02
  • Could you give me some code snippets/examples how could it look like? I really don't get it :( – gabrielQ Jul 31 '19 at 08:51
  • The only thing I have is an example in the doxygen repository and this is unfortunately quite specific. Please google for "doxygen cmake example", maybe https://vicrucann.github.io/tutorials/quick-cmake-doxygen/ will help. – albert Jul 31 '19 at 09:01

0 Answers0