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

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

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P2: Important
    • 6.0.0
    • None
    • Build System
    • 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

              krf Kevin Funk
              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