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

Could not find moc executable target Qt6::moc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0.0 Alpha
    • Build System: CMake
    • None

      We tried Qt6 Alpha today. The build of Qt6 works without problems. But we cannot configure our own cmake based application with Linux here.

      CMake Error: AUTOMOC for target AusweisApp: Could not find moc executable target Qt6::moc
      CMake Generate step failed.  Build files cannot be regenerated correctly.
      

      We looked into Qt5 installation and it seems this is missing in Qt6.

      if (NOT TARGET Qt5::moc)
          add_executable(Qt5::moc IMPORTED)
      
          set(imported_location "${_qt5Core_install_prefix}/bin/moc")
          _qt5_Core_check_file_exists(${imported_location})
      
          set_target_properties(Qt5::moc PROPERTIES
              IMPORTED_LOCATION ${imported_location}
          )
          # For CMake automoc feature
          get_target_property(QT_MOC_EXECUTABLE Qt5::moc LOCATION)
      endif()
      

      If we add that to Qt5CoreConfig.cmake it works. But then RCC is missing.

      FAILED: src/AusweisApp2.rcc 
      cd /.../qt6/resources && --binary --name AusweisAppRcc --output /.../qt6/src/AusweisApp2.rcc /home/andre/hg/AusweisApp2/resources/ausweisapp.qrc /home/andre/hg/AusweisApp2/resources/ausweisapp_desktop.qrc /.../qt6/resources/ausweisapp_qml.qrc /.../qt6/resources/ausweisapp_license.qrc
      /bin/sh: --binary: command not found
      

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

            qtbuildsystem Qt Build System Team
            misery André Klitzing
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes