Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99238

retire qt_parse_all_arguments

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.5.0, 6.6.0
    • 6.2.0, 6.3.0 Feature Freeze
    • Build System: CMake
    • None
    • All
    • dc00369c5 (dev), 7e8257768 (dev), 79228ee66 (dev), edd8b61a0 (dev), 90aafa047 (dev), c2d37f964 (dev), 4402240ff (dev), c00f8b742 (dev), 38d630bd1 (dev), e90cf7f75 (dev), 4373a5e1a (dev), 1b5562d67 (dev), 36406bf54 (dev), c8ccfcda0 (dev), 5b1763796 (dev)

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes