diff --git a/CMakeLists.txt b/CMakeLists.txt index a67da8a..7e8277d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,8 @@ endif() # DOCUMENTATION #---------------------------------- -option(BUILD_DOC "Build doxygen documentation for sdbus-c++ API" ON) +option(BUILD_DOC "Build documentation for sdbus-c++" ON) +option(BUILD_DOXYGEN_DOC "Build doxygen documentation for sdbus-c++ API" OFF) if(BUILD_DOC) add_subdirectory("${CMAKE_SOURCE_DIR}/doc") diff --git a/README.md b/README.md index 332c85b..fa0de22 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,11 @@ $ sudo make install * `BUILD_DOC` [boolean] - Option for building Doxygen documentation of sdbus-c++ API. If `BUILD_DOC` is enabled, the documentation must still be built explicitly through `make doc`. Default value: `ON`. Use `-DBUILD_DOC=OFF` to disable searching for Doxygen and building Doxygen documentation of sdbus-c++ API. + Option for including sdbus-c++ documentation files and tutorials. Default value: `ON`. With this option turned on, you may also enable/disable the following option: + + * `BUILD_DOXYGEN_DOC` [boolean] + + Option for building Doxygen documentation of sdbus-c++ API. If enabled, the documentation must still be built explicitly through `make doc`. Default value: `OFF`. Use `-DBUILD_DOXYGEN_DOC=OFF` to disable searching for Doxygen and building Doxygen documentation of sdbus-c++ API. * `BUILD_TESTS` [boolean] diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 0f648ea..af045e0 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -2,18 +2,20 @@ find_package(Doxygen) -if(DOXYGEN_FOUND) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) +if(BUILD_DOXYGEN_DOC) + if(DOXYGEN_FOUND) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - add_custom_target(doc - COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM) + add_custom_target(doc + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL) -else() - message(WARNING "Documentation enabled, but Doxygen cannot be found") + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR} OPTIONAL) + else() + message(WARNING "Documentation enabled, but Doxygen cannot be found") + endif() endif() install(FILES sdbus-c++-class-diagram.png