Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
CMake Port: Difference between revisions
Jump to navigation
Jump to search
Kevin Funk (talk | contribs) (Add notes) |
No edit summary |
||
Line 1: | Line 1: | ||
This is an overview on the port of Qt from qmake to CMake. | This is an overview on the port of Qt from qmake to CMake. | ||
== Quick Links == | |||
* [https://bugreports.qt.io/browse/QTBUG-73351 Key initiative: Transition to CMake in JIRA] | |||
* [https://lists.qt-project.org/pipermail/development/2018-October/034023.html "Build system for Qt 6" thread on development@qt-project.org] | |||
* [irc://chat.freenode.net:6665/qt-cmake #qt-cmake channel on freenode/IRC] | |||
== Overview == | |||
The current port of qtbase can be found in the [https://codereview.qt-project.org/#/q/project:qt/qtbase+branch:wip/cmake,n,z wip/cmake branch] of qt/qtbase.git. See also [http://code.qt.io/cgit/qt/qtbase.git/tree/cmake/README.md?h=wip/cmake cmake/README.md in the sources.] | |||
== Non-technical issues: == | == Non-technical issues: == | ||
Line 60: | Line 70: | ||
*** Either the code next to the comment is fixed automatically | *** Either the code next to the comment is fixed automatically | ||
*** Or the hand-edited version needs to be kept | *** Or the hand-edited version needs to be kept | ||
Revision as of 10:35, 11 February 2019
This is an overview on the port of Qt from qmake to CMake.
Quick Links
- Key initiative: Transition to CMake in JIRA
- "Build system for Qt 6" thread on development@qt-project.org
- #qt-cmake channel on freenode/IRC
Overview
The current port of qtbase can be found in the wip/cmake branch of qt/qtbase.git. See also cmake/README.md in the sources.
Non-technical issues:
Open Questions
- Qt development workflows:
- Documentation and knowledge transfer:
- Where will the CMake workflow differ from the current qmake one?
- Document the differences and explain why they exist to reduce friction of devs
- building Qt with CMake
- How can we spread the knowledge? In the end everybody needs to work with cmake, so how do we train our devs and contributors to write/update the build system?
- What is the process to get fixes from Qt 5 into Qt 6? We will need to do that for a long time after all
- 3rd party code:
- How do we get external libraries into place -- now that we are getting rid of src/3rdparty? VCPKG? Can we get that decided and into place?
- Projects *using* Qt
- How can we ease the transition of current CMake based Qt 5 projects to Qt6 with CMake? Can we introduce changes to Qt 5 right now to make switching between Qt 5/Qt 6 easier?
- Idea:
- For Qt5:
- Status quo: `find_package(Qt5 ...), results in targets: Qt5::Core.
- In future, also export targets named: Qt::Core (for Qt6 compat)
- Qt6:
- Should: `find_package(Qt6 ...)`, results in targets: Qt::Core
- For Qt5:
- How can we ease the transition of current qmake based Qt 5 projects to Qt6 with CMake?
- Idea: Tobias has porting scripts, but they are very Qt specific
- Probably not useful for the average Qt developer
- Idea: Tobias has porting scripts, but they are very Qt specific
- QMake support in Qt6?
- Customer still need to build QMake projects
- Idea: Make QMake build outside qtbase.git
- Do a verbatim copy of mkspecs for Qt6
- Let CMake generate the QMake module .pri files (via ECM's CMake modules)
- Qt Community:
- How do we communicate the progress to our community and get a community decision on the build system for Qt 6?
- We'll put this document on the wiki, work on it, later turn it into a QUIP
Technical issues
- Do we need more changes in cmake? We want a released cmake with everything we need in time for the Qt 6 release, so we need to push this through review upstream ASAP!
- Work on finding all the 3rd-party code we need. E.g. I got a patch for OpenGL in gerrit that needs some work in the find_packages department.
- Cross compilation: It would be wonderful if somebody with more knowledge in that area could look into this topic.
- CI: What needs to be done to make our CI build cmake projects? Can we get that sorted to get wider test coverage (and an idea how the switch will effect build times:-).
- More passing tests in Qt base
- Better testing of MacOS and Windows.
- Add one more Qt module and see how that works -- building it stand-alone against an already installed QtBase and from a master build directory.
- Idea: Test building qtsvg
- Create a wip/cmake branch on Gerrit (but not necessarily)
- Creator integration
- Currently QtCreator needs `qmake -query` to identify Qt kits
- Needs something similar in the CMake world, basically a Qt description file format (CMake? JSON?)
- Qt build compiler flags
- Qt configure's -developer-build builds with warnings-as-errors, how to do it in CMake?
- Idea: Use ECM code for inspiration? -- will probably still need to enable warnings-as-errors manually
- Library naming: Qt library names are missing SOVERSION, etc. pp.
Porting Notes
- Process of getting new CMakeLists.txt files, ideally:
- Run the conversion script
- Edit the places which fail by hand, add a comment stating that it was edited by hand
- When the conversion script was fixed, and it re-run:
- Either the code next to the comment is fixed automatically
- Or the hand-edited version needs to be kept