0001 # first we can indicate the documentation build as an option and set it to ON by default
0002 #option(BUILD_DOC "Build documentation" ON)
0003
0004 # check if Doxygen is installed
0005 find_package(Doxygen)
0006 if (DOXYGEN_FOUND)
0007 # set input and output files
0008 set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
0009 set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
0010
0011 # request to configure the file
0012 configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
0013 message("Doxygen build started")
0014
0015 # note the option ALL which allows to build the docs together with the application
0016 add_custom_target( doc_doxygen ALL
0017 COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
0018 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
0019 COMMENT "Generating API documentation with Doxygen"
0020 VERBATIM )
0021 else (DOXYGEN_FOUND)
0022 message("Doxygen need to be installed to generate the doxygen documentation")
0023 endif (DOXYGEN_FOUND)
0024