0027339: CMake install should launch generation of overview documentation
authorski <ski@opencascade.com>
Thu, 27 Oct 2016 14:16:24 +0000 (17:16 +0300)
committerapn <apn@opencascade.com>
Thu, 27 Oct 2016 14:16:42 +0000 (17:16 +0300)
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
dox/CMakeLists.txt

index 78966d7..46ad1e2 100644 (file)
@@ -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)
index 4e64e34..34329fa 100644 (file)
@@ -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")