summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 194c25a..b0c28c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,7 @@ mark_as_advanced(AMQP_CODEGEN_DIR)
find_package(POPT)
find_package(XmlTo)
+find_package(Doxygen)
if (POPT_FOUND AND XmlTo_FOUND)
set(DO_DOCS ON)
@@ -65,6 +66,7 @@ option(BUILD_EXAMPLES "Build Examples" ON)
option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND})
option(BUILD_TOOLS_DOCS "Build man pages for Tools (requires xmlto)" ${DO_DOCS})
option(BUILD_TESTS "Build tests (run tests with make test)" ON)
+option(BUILD_API_DOCS "Build Doxygen API docs" ${DOXYGEN_FOUND})
if (WIN32 AND NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "The rabbitmq-c library cannot be built as a static library on Win32. Set BUILD_SHARED_LIBS=ON to get around this.")
@@ -89,6 +91,22 @@ if (BUILD_TESTS)
add_subdirectory(tests)
endif (BUILD_TESTS)
+if (BUILD_API_DOCS)
+ if (NOT DOXYGEN_FOUND)
+ message(FATAL_ERROR "Doxygen is required to build the API documentation")
+ endif ()
+ configure_file(${CMAKE_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_BINARY_DIR}/docs/Doxyfile @ONLY)
+
+ add_custom_target(docs
+ COMMAND ${DOXYGEN_EXECUTABLE}
+ VERBATIM
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs
+ DEPENDS rabbitmq
+ COMMENT "Generating API documentation"
+ SOURCES ${CMAKE_SOURCE_DIR}/docs/Doxyfile.in
+ )
+endif ()
+
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)