diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-08-04 10:01:42 (GMT) |
---|---|---|
committer | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2016-08-16 16:02:35 (GMT) |
commit | c18dc6fbe5b68312be52353aa0a493106584ffe7 (patch) | |
tree | aef64221386463a3acc980f946b65a8f6292cbe5 /Utilities/Doxygen/CMakeLists.txt | |
parent | 6b07972fbdf7e8687577a430597e40e7e0b4831d (diff) | |
download | CMake-c18dc6fbe5b68312be52353aa0a493106584ffe7.zip CMake-c18dc6fbe5b68312be52353aa0a493106584ffe7.tar.gz CMake-c18dc6fbe5b68312be52353aa0a493106584ffe7.tar.bz2 |
Added CMake_BUILD_DEVELOPER_REFERENCE option
By default is OFF and marked as advanced.
It's also add custom cmake-developer-reference (ALL) target
Generated output will be installed to ${CMAKE_DOC_DIR}/developer-reference.
Diffstat (limited to 'Utilities/Doxygen/CMakeLists.txt')
-rw-r--r-- | Utilities/Doxygen/CMakeLists.txt | 92 |
1 files changed, 79 insertions, 13 deletions
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index 813e34d..6ebf2b4 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -10,30 +10,96 @@ # See the License for more information. #============================================================================= +if(NOT CMake_SOURCE_DIR) + set(CMakeDeveloperReference_STANDALONE 1) + cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR) + get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) + get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) + include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) + include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake) + include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) + unset(CMAKE_DATA_DIR) + unset(CMAKE_DATA_DIR CACHE) + macro(CMake_OPTIONAL_COMPONENT) + set(COMPONENT "") + endmacro() +endif() + +project(CMakeDeveloperReference NONE) + # -# Build the documentation +# Build the reference # -include (${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) -if (BUILD_DOCUMENTATION) +if (CMake_BUILD_DEVELOPER_REFERENCE OR CMakeDeveloperReference_STANDALONE) + + find_package(Doxygen REQUIRED) + + # + ## Output formats + # + + option(CMake_BUILD_DEVELOPER_REFERENCE_HTML "Build CMake Developer Reference - HTML format" ON) + mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_HTML) + if(CMake_BUILD_DEVELOPER_REFERENCE_HTML) + set(GENERATE_HTML YES) + else() + set(GENERATE_HTML NO) + endif() + + option(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP "Build CMake Developer Reference - QtHelp format" OFF) + mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP) + if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP) + set(GENERATE_QHP YES) + find_program(QHELPGENERATOR_EXECUTABLE + NAMES qhelpgenerator + DOC "qhelpgenerator tool" + ) + if(NOT QHELPGENERATOR_EXECUTABLE) + message(FATAL_ERROR "QHELPGENERATOR_EXECUTABLE (qhelpgenerator) not found!") + endif() + else() + set(GENERATE_QHP NO) + endif() # # Configure the script and the doxyfile, then add target # + + if(DOXYGEN_DOT_FOUND) + set(HAVE_DOT YES) + else() + set(HAVE_DOT NO) + endif() + if(NOT DOT_PATH) - get_filename_component(DOT_PATH ${DOT} PATH) + get_filename_component(DOT_PATH ${DOXYGEN_DOT_EXECUTABLE} PATH) endif() - configure_file( - ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in - ${CMake_BINARY_DIR}/Utilities/Doxygen/doxyfile) + configure_file(doxyfile.in doxyfile @ONLY) + + add_custom_target(cmake-developer-reference-all + ${DOXYGEN_EXECUTABLE} doxyfile + WORKING_DIRECTORY ${CMakeDeveloperReference_BINARY_DIR}) + + add_custom_target(cmake-developer-reference ALL DEPENDS cmake-developer-reference-all) - configure_file( - ${CMake_SOURCE_DIR}/Utilities/Doxygen/doc_makeall.sh.in - ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) + # + # Installation + # - add_custom_target(DoxygenDoc - ${BASH} - ${CMake_BINARY_DIR}/Utilities/Doxygen/doc_makeall.sh) + if(CMake_BUILD_DEVELOPER_REFERENCE_HTML) + CMake_OPTIONAL_COMPONENT(cmake-developer-reference-html) + install(DIRECTORY "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/html" + DESTINATION ${CMAKE_DOC_DIR}/developer-reference + ${COMPONENT}) + endif() + + if(CMake_BUILD_DEVELOPER_REFERENCE_QTHELP) + CMake_OPTIONAL_COMPONENT(cmake-developer-reference-qthelp) + install(FILES "${CMakeDeveloperReference_BINARY_DIR}/developer-reference/CMakeDeveloperReference-${CMake_VERSION_MAJOR}${CMake_VERSION_MINOR}${CMake_VERSION_PATCH}.qch" + DESTINATION ${CMAKE_DOC_DIR}/developer-reference + ${COMPONENT}) + endif() endif () |