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

qtbase plugandpaint app example has corrupted CMakeLists.txt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.2.0 Alpha
    • 6.0.1
    • Build System: CMake
    • None
    • 4caac1feea025b0ad496141e8f16ab88c04c2caa (qt/qtbase/dev)

      Looks like the pro2cmake.py translation made a bit of a mess of the file at qtbase/examples/widgets/tools/plugandpaint/app/CMakeLists.txt. There's invalid CMake syntax in various places and it looks like the translation went a bit haywire:

      if(macx-xcode)
          target_link_libraries(plugandpaint PUBLIC
              (
              )
              pnp_basictools$
          )
      endif()
      
      if(NOT macx-xcode)
          target_link_libraries(plugandpaint PUBLIC
              pnp_basictools
          )
      endif()
      
      if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (APPLE))
          target_link_libraries(plugandpaint PUBLIC
              (LIBS, 0)
              (LIBS, 1)
              _debug
          )
      endif()
      
      if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (WIN32))
          target_link_libraries(plugandpaint PUBLIC
              (LIBS, 0)
              (LIBS, 1)
              d
          )
      endif()
      

      A secondary issue is that this CMakeLists.txt file refers to the pnp_basictools library, but that is built by a sibling directory. When the app example is built on its own, it can't find the pnp_basictools library because it isn't part of the same build.

      I'm wondering if the app and plugins are supposed to be separate example projects or whether they should be a single project. There seems to be other examples that do it both ways, so there isn't a single consistent convention for this.

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

            jbornema Joerg Bornemann
            crscott Craig Scott
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes