summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-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