add BUILD_DOCUMENTATION option

This commit is contained in:
Mark Brand 2013-11-16 12:00:16 +01:00
parent 7209863438
commit 3478becf9e

View File

@ -941,20 +941,27 @@ ENDIF()
##############################################################################
# Documentation
FIND_PACKAGE(Doxygen)
OPTION(
VMIME_BUILD_DOCUMENTATION
"Build documentation"
ON
)
IF(DOXYGEN_FOUND)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY)
IF(VMIME_BUILD_DOCUMENTATION)
FIND_PACKAGE(Doxygen)
# Make a target so that documentation can be generated by running "make doc"
ADD_CUSTOM_TARGET(
doc
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
ENDIF(DOXYGEN_FOUND)
IF(DOXYGEN_FOUND)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile @ONLY)
# Make a target so that documentation can be generated by running "make doc"
ADD_CUSTOM_TARGET(
doc
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
ENDIF(DOXYGEN_FOUND)
ENDIF(VMIME_BUILD_DOCUMENTATION)
##############################################################################
# Sanity checks