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

QtWebEngine uses invalid cmake arguments for file()

    XMLWordPrintable

Details

    • 14568476f (dev), 64279b0b0 (6.6)

    Description

      We are currently building QtWebEngine v6.5.1 with yocto and it fails at cmake configure with cmake version 3.16.3:

      CMake Error at cmake/Functions.cmake:461 (file):                                                                                                   
        file Unknown argument to GENERATE subcommand.                                                                                                    
      Call Stack (most recent call first):                                                                                                                                                                                                                                                                  
        cmake/Functions.cmake:1165 (add_linker_options)                                                                                                                                                                                                                                                     
        src/core/CMakeLists.txt:549 (add_gn_build_aritfacts_to_target)   
      

      If you look in cmake/Functions.cmake at line 461, you will see the file() command:

      file(GENERATE OUTPUT ${lflags_filter_script}
        CONTENT "file(STRINGS ${lflags_rsp} lflags)
      		   string(REGEX MATCHALL \"-L.*\" lflags_filtered \${lflags})
      		   file(WRITE ${lflags_filtered_rsp} \${lflags_filtered})"
        FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
      )
      

      The CMakeLists.txt states the minimal version required is 3.16:

      cmake_minimum_required(VERSION 3.16)
      

      Looking at the cmake documentation, you can see that the FILE_PERMISSIONS argument for the GENERATE file command is only valid in version 3.20 or later:
      https://cmake.org/cmake/help/v3.20/command/file.html#writing

      This causes the above cmake error. Possible solutions:

      • Execute chmod for the file to change the file permissions with add_custom_command()
      • Set cmake_minimum_required to 3.20
      • Set cmake_minimum_required to 3.19 and use file(CHMOD ...)
      • Remove FILE_PERMISSIONS argument (works for me, everything compiles just fine without it)

      Just a note: On line 1284, there is an explicit check for the cmake version >3.21, before it uses file GENERATE command with FILE_PERMISSIONS argument.

      Attachments

        Activity

          People

            qt_webengine_team Qt WebEngine Team
            kkettinger Kevin Kettinger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: