From 75378f50eab683fb721072a8cd4674e6e3b8fb09 Mon Sep 17 00:00:00 2001 From: ski Date: Thu, 27 Oct 2016 17:16:24 +0300 Subject: [PATCH] 0027339: CMake install should launch generation of overview documentation Documentation is generated automatically during build/install process Added check of minimum Doxygen version. Install process causes generation of Overview documentation (unless already generated) by checking of occt_logo.png file existing. Overview project regenerates documentation if any source file was changed. --- adm/cmake/doxygen.cmake | 5 +++-- dox/CMakeLists.txt | 23 +++++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/adm/cmake/doxygen.cmake b/adm/cmake/doxygen.cmake index 78966d7584..46ad1e2e15 100644 --- a/adm/cmake/doxygen.cmake +++ b/adm/cmake/doxygen.cmake @@ -1,9 +1,10 @@ # doxygen +set (DOXYGEN_MINIMUM_VERSION 1.8.4) if (DO_ONLY_CHECK_FOR_DOXYGEN) message (STATUS "Info. Detecting doxygen") set (DOXYGEN_SKIP_DOT ON) - find_package (Doxygen) + find_package (Doxygen ${DOXYGEN_MINIMUM_VERSION}) set (CAN_DOXYGEN_BE_USED OFF) if (DOXYGEN_EXECUTABLE) @@ -33,7 +34,7 @@ else() if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE OR (NOT 3RDPARTY_SKIP_DOT_EXECUTABLE AND NOT 3RDPARTY_DOT_EXECUTABLE)) set (DOXYGEN_SKIP_DOT ${3RDPARTY_SKIP_DOT_EXECUTABLE}) - find_package (Doxygen) + find_package (Doxygen ${DOXYGEN_MINIMUM_VERSION}) if (NOT 3RDPARTY_DOXYGEN_EXECUTABLE AND DOXYGEN_EXECUTABLE) set (3RDPARTY_DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}" CACHE FILEPATH "${3RDPARTY_DOXYGEN_EXECUTABLE_DESCR}" FORCE) diff --git a/dox/CMakeLists.txt b/dox/CMakeLists.txt index 4e64e34d70..34329fa407 100644 --- a/dox/CMakeLists.txt +++ b/dox/CMakeLists.txt @@ -92,11 +92,22 @@ file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nMATHJAX_RELPATH = ${3RDPARTY_M # Copy index file to provide fast access to HTML documentation file(COPY "${OCCT_OVERVIEW_RESOURCE_DIR}/index.html" DESTINATION "${OCCT_GENERATED_OVERVIEW_DIR}") -add_custom_target (${PROJECT_NAME} - COMMAND ${3RDPARTY_DOXYGEN_EXECUTABLE} ${OCCT_CONFIG_FOR_DOXYGEN} - WORKING_DIRECTORY ${OCCT_GENERATED_DOC_DIR} - COMMENT "Generating OCCT overview documentation with Doxygen" - SOURCES ${OCCT_ARTICLES_ABSPATH} - VERBATIM) +# get relative paths to documentation source files +file (GLOB_RECURSE OCCT_OVERVIEW_FILES "${OCCT_OVERVIEW_DIR}/*") +add_custom_command(OUTPUT "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png" + COMMAND ${3RDPARTY_DOXYGEN_EXECUTABLE} ${OCCT_CONFIG_FOR_DOXYGEN} + DEPENDS ${OCCT_OVERVIEW_FILES} + WORKING_DIRECTORY ${OCCT_GENERATED_DOC_DIR} + COMMENT "Generating OCCT overview documentation with Doxygen" + VERBATIM +) + +add_custom_target(${PROJECT_NAME} ALL + DEPENDS "${OCCT_GENERATED_DOC_DIR}/overview/html/occt_logo.png" ${OCCT_OVERVIEW_FILES} + SOURCES ${OCCT_ARTICLES_ABSPATH} + VERBATIM +) + +# Create Documentation folder in solution view set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Documentation")