# So CMake can tell whether or not it can process this file cmake_minimum_required(VERSION 3.0 FATAL_ERROR) find_package(Doxygen) option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND}) if(BUILD_DOCUMENTATION) if(NOT DOXYGEN_FOUND) message(FATAL_ERROR "Doxygen is needed to build the documentation.") endif(NOT DOXYGEN_FOUND) set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) set(doxy_main_page ${CMAKE_SOURCE_DIR}/README.md) configure_file(${doxyfile_in} ${doxyfile} @ONLY) add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc) endif(BUILD_DOCUMENTATION)