Details
-
Type:
Task
-
Status: Open
-
Priority:
P2: Important
-
Resolution: Unresolved
-
Affects Version/s: 6.2.0, 6.3.0 Feature Freeze
-
Fix Version/s: None
-
Component/s: Build System: CMake
-
Labels:None
-
Platform/s:
Description
The internal CMake macro qt_parse_all_arguments is problematic.
For details see the comments in https://codereview.qt-project.org/c/qt/qtbase/+/386547
In short, we cannot use qt_configure_file for CONTENT that contains semicolons.
The arguments of
qt_configure_file(OUTPUT foo.txt CONTENT "\\foo\\bar\\\\\\\\;narf")
are split into
arg_OUTPUT: foo.txt arg_CONTENT: \foo\bar\\\\ UNPARSED_ARGUMENTS: narf
because we use qt_parse_all_arguments.
Ideally, qt_parse_all_arguments would use the PARSE_ARGV signature of cmake_parse_arguments. But it cannot, because it's a macro, and said signature is for functions only.
Fix proposal:
- Create a macro _qt_internal_validate_all_args_are_parsed(${result}) and use that at the call sites of qt_parse_all_arguments.
- Replace all usage of qt_parse_all_arguments with cmake_parse_arguments(PARSE_ARGV)
- Remove extra escaping of backslashes from the call sites, if there is any.