FindDoxygen: Tolerate empty output formats

Amend commit 8fc8f564c9 (FindDoxygen: Create and clean recursive
subdirectories for output formats, 2026-08-09) to avoid syntax errors
with undefined variables.

Fixes: #28222
This commit is contained in:
Tyler Yankee committed 2026-10-29 09:30:36 -04:00
1 parent bc7346c06b
commit 63e7673d0b
2 files changed
+12 -3

No files matched your search

+2 -2
View File
@@ -1178,9 +1178,9 @@ function(_doxygen_collect_output_dirs outputDirs)
set(_doxygen_output_dirs "")
foreach(_format IN LISTS _doxygen_output_formats)
set(_doxygen_generate_format "DOXYGEN_GENERATE_${_format}")
if(DEFINED "${_doxygen_generate_format}" AND ${${_doxygen_generate_format}})
if(${_doxygen_generate_format})
set(_doxygen_format_output "DOXYGEN_${_format}_OUTPUT")
if(DEFINED _doxygen_format_output)
if(DEFINED ${_doxygen_format_output})
list(APPEND _doxygen_output_dirs "${${_doxygen_format_output}}" )
endif()
unset(_doxygen_format_output)
+10 -1
View File
@@ -57,5 +57,14 @@ foreach(f IN LISTS expectedList)
endif()
endforeach()
# Tolerate output formats explicitly set to an empty value.
set(DOXYGEN_OUTPUT_DIRECTORY emptyGenerate)
set(DOXYGEN_GENERATE_LATEX "")
doxygen_add_docs(docsEmptyGenerate main.cpp)
unset(DOXYGEN_GENERATE_LATEX)
if(NOT TARGET docsEmptyGenerate)
message(FATAL_ERROR "Target docsEmptyGenerate not created")
endif()
add_custom_target(allDocTargets)
add_dependencies(allDocTargets docsNoArgs docsWithArgs)
add_dependencies(allDocTargets docsNoArgs docsWithArgs docsEmptyGenerate)