summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristoph GrĂ¼ninger <foss@grueninger.de>2023-09-19 15:11:40 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-22 14:11:22 (GMT)
commit59a4aaa2374d9ad20c3c8b5080b73d3cb760a03a (patch)
tree143a469a9252146eafcf9af86e9e267b19425d08 /Modules
parent62df021464ad7be09dd34ab6b738806ae70e3118 (diff)
downloadCMake-59a4aaa2374d9ad20c3c8b5080b73d3cb760a03a.zip
CMake-59a4aaa2374d9ad20c3c8b5080b73d3cb760a03a.tar.gz
CMake-59a4aaa2374d9ad20c3c8b5080b73d3cb760a03a.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindDoxygen.cmake21
1 files 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()