Details
-
User Story
-
Resolution: Done
-
P2: Important
-
None
-
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
- relates to
-
QTBUG-75090 Support building tests with an installed Qt which was built with cmake
- Closed