From 2e8398bd6f9326651460992e6e3a0121df449e83 Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 19:55:37 +0200 Subject: Add doxygen documentation to CMake --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index b2f5970..6358d34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(TgBot) # options option(ENABLE_TESTS "Set to ON to enable building of tests" OFF) option(BUILD_SHARED_LIBS "Build tgbot-cpp shared/static library." OFF) +option(BUILD_DOCUMENTATION "Build doxygen API documentation." OFF) # sources set(CMAKE_CXX_STANDARD 14) @@ -90,6 +91,17 @@ if (ENABLE_TESTS) add_subdirectory(test) endif() +# Documentation +if(BUILD_DOCUMENTATION) + find_package(Doxygen REQUIRED) + add_custom_target(doc_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/ TYPE DOC) +endif() + if(MSVC AND BUILD_SHARED_LIBS) add_definitions(-DTGBOT_DLL) endif() \ No newline at end of file -- cgit v1.2.3