From 7cad79d0182b9ab0a88039e39822a704c2b258fb Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Tue, 22 Oct 2019 15:16:44 +0200 Subject: ECMAddQch: support PREDEFINED_MACROS/BLANK_MACROS with blanks & quotes --- modules/ECMAddQch.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/ECMAddQch.cmake b/modules/ECMAddQch.cmake index 88b84783..cae829f1 100644 --- a/modules/ECMAddQch.cmake +++ b/modules/ECMAddQch.cmake @@ -565,12 +565,16 @@ function(ecm_add_qch target_name) set(ECM_QCH_DOXYGEN_PREDEFINED_MACROS) foreach(_macro IN LISTS ARGS_PREDEFINED_MACROS) # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_QCH_DOXYGEN_PREDEFINED_MACROS "${ECM_QCH_DOXYGEN_PREDEFINED_MACROS} \\\n${_macro}") + # wrap each macro in quotes, to handle potential blanks and commas + string(REPLACE "\"" "\\\"" _macro "${_macro}") + set(ECM_QCH_DOXYGEN_PREDEFINED_MACROS "${ECM_QCH_DOXYGEN_PREDEFINED_MACROS} \\\n\"${_macro}\"") endforeach() set(ECM_QCH_DOXYGEN_BLANK_MACROS) foreach(_macro IN LISTS ARGS_BLANK_MACROS) # concat dirs separated by a break, it is no issue that first has also a leading break - set(ECM_QCH_DOXYGEN_BLANK_MACROS "${ECM_QCH_DOXYGEN_BLANK_MACROS} \\\n${_macro}=\"\"") + # wrap each macro in quotes, to handle potential blanks and commas + string(REPLACE "\"" "\\\"" _macro "${_macro}") + set(ECM_QCH_DOXYGEN_BLANK_MACROS "${ECM_QCH_DOXYGEN_BLANK_MACROS} \\\n\"${_macro}=\"") endforeach() # create list of tag files for linking other QCH files -- cgit v1.2.1