mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
Documentation - Generation schema fixing #452
Enhance documentation generation by tracking unique module connections Ensuring lowercase page IDs for toolkits and packages
This commit is contained in:
parent
9cd174509c
commit
c291a33d6d
@ -1184,7 +1184,7 @@ foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
|
|||||||
add_subdirectory ("${OCCT_${BUILD_TOOLKIT}_FILES_LOCATION}")
|
add_subdirectory ("${OCCT_${BUILD_TOOLKIT}_FILES_LOCATION}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if (BUILD_DOC_Overview)
|
if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)
|
||||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_doc")
|
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_doc")
|
||||||
# Setup documentation targets
|
# Setup documentation targets
|
||||||
OCCT_SETUP_DOC_TARGETS()
|
OCCT_SETUP_DOC_TARGETS()
|
||||||
|
@ -31,6 +31,9 @@ function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
|
|||||||
# Create .dot file for module dependencies
|
# Create .dot file for module dependencies
|
||||||
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
file(WRITE ${DOT_FILE} "digraph ${FILENAME}\n{\n")
|
||||||
|
|
||||||
|
# Create a list to track unique module connections
|
||||||
|
set(MODULE_CONNECTIONS)
|
||||||
|
|
||||||
foreach(MODULE ${OCCT_MODULES})
|
foreach(MODULE ${OCCT_MODULES})
|
||||||
if(NOT "${MODULE}" STREQUAL "")
|
if(NOT "${MODULE}" STREQUAL "")
|
||||||
# module name in lowercase
|
# module name in lowercase
|
||||||
@ -41,7 +44,15 @@ function(OCCT_DOC_CREATE_MODULE_DEPENDENCY_GRAPH OUTPUT_DIR FILENAME)
|
|||||||
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
|
foreach(DEPENDENT_TOOLKIT ${TOOLKIT_DEPENDENCY_${MODULE_TOOLKIT}})
|
||||||
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
if(DEFINED TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT} AND
|
||||||
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
|
NOT "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}" STREQUAL "${MODULE}")
|
||||||
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
# Create a unique connection identifier
|
||||||
|
set(CONNECTION "${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}}->${MODULE}")
|
||||||
|
list(FIND MODULE_CONNECTIONS "${CONNECTION}" CONNECTION_EXISTS)
|
||||||
|
|
||||||
|
# Add connection only if it doesn't exist yet
|
||||||
|
if(${CONNECTION_EXISTS} EQUAL -1)
|
||||||
|
list(APPEND MODULE_CONNECTIONS "${CONNECTION}")
|
||||||
|
file(APPEND ${DOT_FILE} "\t${TOOLKIT_PARENT_MODULE_${DEPENDENT_TOOLKIT}} -> ${MODULE} [ dir = \"back\", color = \"midnightblue\", style = \"solid\" ]\n")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
@ -147,7 +158,9 @@ function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
|
|||||||
|
|
||||||
# List toolkits in the module
|
# List toolkits in the module
|
||||||
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
foreach(TOOLKIT ${TOOLKITS_IN_MODULE_${MODULE}})
|
||||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT}\n")
|
# page id must be in lowercase
|
||||||
|
string(TOLOWER ${TOOLKIT} TOOLKIT_LOWER)
|
||||||
|
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage toolkit_${TOOLKIT_LOWER}\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Add module diagram
|
# Add module diagram
|
||||||
@ -169,7 +182,9 @@ function(OCCT_DOC_GENERATE_MAIN_PAGE OUTPUT_DIR OUTPUT_FILE)
|
|||||||
# List packages in toolkit
|
# List packages in toolkit
|
||||||
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
foreach(PACKAGE ${PACKAGES_IN_TOOLKIT_${TOOLKIT}})
|
||||||
set(PACKAGE_NAME ${PACKAGE})
|
set(PACKAGE_NAME ${PACKAGE})
|
||||||
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME}\n")
|
# page id must be in lowercase
|
||||||
|
string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER)
|
||||||
|
file(APPEND ${MAIN_PAGE_FILE} "\\li \\subpage package_${PACKAGE_NAME_LOWER}\n")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Add toolkit dependencies diagram
|
# Add toolkit dependencies diagram
|
||||||
@ -645,7 +660,6 @@ function(OCCT_SETUP_DOC_TARGETS)
|
|||||||
DEPENDS RefMan Overview
|
DEPENDS RefMan Overview
|
||||||
COMMENT "Generating all documentation"
|
COMMENT "Generating all documentation"
|
||||||
)
|
)
|
||||||
set_property (TARGET doc PROPERTY FOLDER "Documentation")
|
|
||||||
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
set_property (TARGET Overview PROPERTY FOLDER "Documentation")
|
||||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||||
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
|
add_dependencies(Overview RefMan) # Ensure Overview uses RefMan tag file
|
||||||
@ -662,4 +676,5 @@ function(OCCT_SETUP_DOC_TARGETS)
|
|||||||
)
|
)
|
||||||
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
set_property (TARGET RefMan PROPERTY FOLDER "Documentation")
|
||||||
endif()
|
endif()
|
||||||
|
set_property (TARGET doc PROPERTY FOLDER "Documentation")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user