issue #8689 Regression documentation build (#8698)

- compare doxygen version with the available directories on disk and
(try to) use the most appropriate one
- give a warning when there are more directories than expected (already
present), though `FATAL` should probably be `FATAL_ERROR` though the
latest will give problems when adding a new version to the directory
list for testing. Changed the message to a `WARNING`
This commit is contained in:
Sebastien Loriot 2025-02-12 19:45:14 +01:00 committed by GitHub
commit f079630f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 6 deletions

View File

@ -299,8 +299,8 @@ file(GLOB CGAL_DOXYGEN_RESOURCES_DIRS
list(SORT CGAL_DOXYGEN_RESOURCES_DIRS COMPARE NATURAL)
if(NOT CGAL_DOXYGEN_RESOURCES_DIRS STREQUAL CGAL_DOXYGEN_RESOURCES_VERSIONS)
message(FATAL "The directories in ${CGAL_DOC_RESOURCE_PREFIX_DIR} do not match the
expected versions: [${CGAL_DOXYGEN_RESOURCES_VERSIONS}] vs [${CGAL_DOXYGEN_RESOURCES_DIRS}]")
message(WARNING "The directories in ${CGAL_DOC_RESOURCE_PREFIX_DIR} do not match the expected versions:\n"
" [${CGAL_DOXYGEN_RESOURCES_DIRS}] vs [${CGAL_DOXYGEN_RESOURCES_VERSIONS}]")
endif()
function(CGAL_insert_in_sorted_list list_name value)
@ -312,14 +312,15 @@ function(CGAL_insert_in_sorted_list list_name value)
set(${list_name} ${list} PARENT_SCOPE)
endfunction()
if(DOXYGEN_VERSION IN_LIST CGAL_DOXYGEN_RESOURCES_VERSIONS)
list(FIND CGAL_DOXYGEN_RESOURCES_VERSIONS "${DOXYGEN_VERSION}" DOXYGEN_VERSION_INDEX)
if(DOXYGEN_VERSION IN_LIST CGAL_DOXYGEN_RESOURCES_DIRS)
list(FIND CGAL_DOXYGEN_RESOURCES_DIRS "${DOXYGEN_VERSION}" DOXYGEN_VERSION_INDEX)
else()
CGAL_insert_in_sorted_list(CGAL_DOXYGEN_RESOURCES_VERSIONS ${DOXYGEN_VERSION})
list(FIND CGAL_DOXYGEN_RESOURCES_VERSIONS ${DOXYGEN_VERSION} DOXYGEN_VERSION_INDEX)
CGAL_insert_in_sorted_list(CGAL_DOXYGEN_RESOURCES_DIRS ${DOXYGEN_VERSION})
list(FIND CGAL_DOXYGEN_RESOURCES_DIRS ${DOXYGEN_VERSION} DOXYGEN_VERSION_INDEX)
math(EXPR DOXYGEN_VERSION_INDEX "${DOXYGEN_VERSION_INDEX} - 1")
endif()
list(GET CGAL_DOXYGEN_RESOURCES_DIRS "${DOXYGEN_VERSION_INDEX}" CGAL_DOC_RESOURCE_DIR)
set(CGAL_DOC_RESOURCE_DIR "${CGAL_DOC_RESOURCE_PREFIX_DIR}/${CGAL_DOC_RESOURCE_DIR}")
if(NOT EXISTS "${CGAL_DOC_RESOURCE_DIR}")
message(FATAL_ERROR "Doxygen resources for version ${DOXYGEN_VERSION} not found")