summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2012-07-16 23:12:22 -0400
committerAlan Antonuk <alan.antonuk@gmail.com>2012-07-16 23:57:23 -0400
commit30151e2f86612ca4cbd2c6f5cd53f4b1ea9dd6fb (patch)
treedbbdf103ca1759b1d410a241c35b4eab3da0500e /CMakeLists.txt
parentfabfafd8260dc08352c08b0d2766d8cb48066770 (diff)
downloadrabbitmq-c-github-ask-api_docs.tar.gz
Adding skeleton of Doxygen documentationapi_docs
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)