diff --git a/CMakeLists.txt b/CMakeLists.txt index 55448e2e..75879343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,3 +20,14 @@ endif(Boost_FOUND) include_directories(${marian_SOURCE_DIR}/src) add_subdirectory(src) + +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + add_custom_target(doc ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" VERBATIM + ) +endif(DOXYGEN_FOUND) diff --git a/Doxyfile b/Doxyfile.in similarity index 99% rename from Doxyfile rename to Doxyfile.in index 0e1a68ce..e82982ff 100644 --- a/Doxyfile +++ b/Doxyfile.in @@ -743,7 +743,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = src +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/README.md b/README.md index 67685375..7026c615 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,6 @@ Compilation with `cmake > 3.5`: cmake .. make -j +To compile API documentation using Doxygen, first cd to the build directory, and then: + + make doc