diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2e29eec8e5b..8c9e9bcd8fc 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -3182,7 +3182,15 @@ endfunction() # Generate a few output files using qlalr, and assign those to 'consuming_target'. # 'input_file_list' is a list of 'foo.g' file paths. # 'flags' are extra flags to be passed to qlalr. -function(qt_process_qlalr input_file_list consuming_target flags) +function(qt_process_qlalr consuming_target input_file_list flags) + # For compatibility, swap parameters if called from an old call site. + if (NOT TARGET "${consuming_target}") + set(tmp "${consuming_target}") + set(consuming_target "${input_file_list}") + set(input_file_list "${tmp}") + unset(tmp) + endif() + foreach(input_file ${input_file_list}) file(STRINGS ${input_file} input_file_lines) qt_qlalr_find_option_in_list("${input_file_lines}" "^%parser(.+)" "parser") diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index bf73c87e449..a9504d17c98 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1984,8 +1984,8 @@ def write_qlalrsources(cm_fh: IO[str], target: str, scope: Scope, indent: int = cm_fh.write("\n# QLALR Grammars:\n") cm_fh.write(f"qt_process_qlalr(\n") indent += 1 - cm_fh.write(f"{spaces(indent)}{';'.join(sources)}\n") cm_fh.write(f"{spaces(indent)}{target}\n") + cm_fh.write(f"{spaces(indent)}{';'.join(sources)}\n") cm_fh.write(f'{spaces(indent)}""\n') cm_fh.write(")\n")