summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTransporter <ogre.transporter@gmail.com>2020-04-30 19:55:37 +0200
committerTransporter <ogre.transporter@gmail.com>2020-04-30 19:55:37 +0200
commit2e8398bd6f9326651460992e6e3a0121df449e83 (patch)
tree533242748eb9274ceac96e25329d66e51767db8f
parentb108df643ac3f7cde4e762dcc55483616b2ed2cd (diff)
Add doxygen documentation to CMake
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
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