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

Support building examples with an installed Qt which was built with cmake

    XMLWordPrintable

    Details

    • Type: User Story
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.0.0
    • Component/s: Build System
    • Labels:
      None

      Description

      I talked with Tobias about this.

      Currently the pro2cmake generator script generates add_qt_executable() calls for example projects.
      This means that you can't really build a separate example with an installed Qt, because the QtBuild.cmake file and friends (that contain add_qt_executable) are not installed.

      The suggestion would be to build all examples within the Qt CMake build process as it is now, and then when installing Qt, make sure to copy all example sources and generate a new CMakeLists.txt file for each example, which would use regular CMake functions (so add_executable + find_package(Qt5) instead of add_qt_executable) to build itself.

      That's at least the initial proposal, there might be a better way of doing this.

      An alternative might be to change the generator script to output example CMakeLists.txt files which could accommodate both cases of building as part of Qt, as well as as a separate project.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              krf Kevin Funk
              Reporter:
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes