From 59a4aaa2374d9ad20c3c8b5080b73d3cb760a03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Tue, 19 Sep 2023 17:11:40 +0200 Subject: FindDoxygen: Disable Doxygen if executable returns non-zero result This makes detection of Doxygen more robust in case of broken Doxygen executables. Doxygen is called to determine its version number. If this call returns a non-zero result, we have an indication that the Doxygen executable is broken. We report Doxygen as not found to prevent issues with checks for other Doxygen component, that might lead to configuration aborts. Fixes: #18708 --- Modules/FindDoxygen.cmake | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 76f4759..7ea9d89 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -494,15 +494,18 @@ macro(_Doxygen_find_doxygen) _Doxygen_get_version(DOXYGEN_VERSION _Doxygen_version_result "${DOXYGEN_EXECUTABLE}") if(_Doxygen_version_result) - message(WARNING "Unable to determine doxygen version: ${_Doxygen_version_result}") - endif() - - # Create an imported target for Doxygen - if(NOT TARGET Doxygen::doxygen) - add_executable(Doxygen::doxygen IMPORTED GLOBAL) - set_target_properties(Doxygen::doxygen PROPERTIES - IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}" - ) + if(NOT Doxygen_FIND_QUIETLY) + message(WARNING "Doxygen executable failed unexpected while determining version (exit status: ${_Doxygen_version_result}). Disabling Doxygen.") + endif() + set(DOXYGEN_EXECUTABLE "${DOXYGEN_EXECUTABLE}-FAILED_EXECUTION-NOTFOUND") + else() + # Create an imported target for Doxygen + if(NOT TARGET Doxygen::doxygen) + add_executable(Doxygen::doxygen IMPORTED GLOBAL) + set_target_properties(Doxygen::doxygen PROPERTIES + IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}" + ) + endif() endif() endif() endmacro() -- cgit v0.12 From a960b901de29d4b9c422080d54bcae468a07a8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Tue, 19 Sep 2023 17:13:01 +0200 Subject: FindDoxygen: Remove redundant debug message when Doxygen fails We warn for this now. --- Modules/FindDoxygen.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index 7ea9d89..9903e37 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -463,10 +463,6 @@ function(_Doxygen_version_validator version_match doxy_path) else() _Doxygen_get_version(candidate_version version_result "${doxy_path}") - if(version_result) - message(DEBUG "Unable to determine candidate doxygen version at ${doxy_path}: ${version_result}") - endif() - find_package_check_version("${candidate_version}" valid_doxy_version HANDLE_VERSION_RANGE ) -- cgit v0.12