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

"Target "gallery_controls2" links to target "Qt::QuickTemplates2" but the target was not found" when building gallery example

    XMLWordPrintable

Details

    • Windows
    • 885abf6147bf2260dc21d9b8e1752d6f39b315ca (qt/qtquickcontrols2/dev) 80e53d4eda0acabbe83a9feb80fc5f2dc47f969b (qt/qtquickcontrols2/6.0)

    Description

      When running cmake on the gallery example on Windows 10, I get this error:

      CMake Error at C:/dev/qt-dev-debug/qtbase/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:445 (add_executable):
        Target "gallery_controls2" links to target "Qt::QuickTemplates2" but the
        target was not found.  Perhaps a find_package() call is missing for an
        IMPORTED target, or an ALIAS target is missing?
      

      which I worked around with by commenting out this line:

      diff --git a/examples/quickcontrols2/gallery/CMakeLists.txt b/examples/quickcontrols2/gallery/CMakeLists.txt
      index ecb308c7a..32cd0dbe5 100644
      --- a/examples/quickcontrols2/gallery/CMakeLists.txt
      +++ b/examples/quickcontrols2/gallery/CMakeLists.txt
      @@ -34,7 +34,7 @@ target_link_libraries(gallery_controls2 PUBLIC # special case
           Qt::QuickControls2
       # special case begin
           # Work around QTBUG-86533
      -    Qt::QuickTemplates2
      +#    Qt::QuickTemplates2
       # special case end
       )
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-89290
          # Subject Branch Project Status CR V

          Activity

            People

              mitch_curtis Mitch Curtis
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes