-
-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run lrelease during cmake build instead of pre-build #3009
Conversation
Seems like a very sensible move. @cmaughan - do you have any comments on this? |
Assuming this only happens once, it is fine; I thought it was in the prebuild because it was happening all the time. |
@cmaughan - excellent point. We don't necessarily want to run |
tight dev cycles or not, if it adds any unnecessary build time, then it reduces speed of light, as we say here. You pay that every time you fire up the build, which isn't acceptable. But it is OK if handled properly and Qt only rebuilds if those files change - which would be better than the script. |
@cmaughan @samaaron I just quickly tried this on my system with Qt5 and it correctly only rebuilt the .qm files when the corresponding .ts files changed. Subsequent runs did not rebuild any files that did not change and if none were changed, it did not bother rebuilding Build log
|
63a4a89
to
c74752b
Compare
Rebasing has been done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the QT5_BIN_DIR
-related lines at the top of mac-prebuild.sh too, since those are now unnecessary/unused?
(random side-note, but it seems I can't add comments in the GitHub interface around lines that weren't modified so I linked them above instead)
This is now handled by the Qt GUI's CMakeLists.txt.
c74752b
to
76f82fd
Compare
Done :) |
Thanks for this :-) |
This PR moves the step which runs lrelease on the .ts files into the CMakeList, which runs it at build time.
This needs testing to see if it works fine on Qt6.
This is done using the Qt Linguist Tools cmake functions.
In Qt6 there's
qt_add_lrelease
which runs lrelease and sets the files as dependencies to the target: https://doc-snapshots.qt.io/qt6-6.3/qtlinguist-cmake-qt-add-lrelease.htmlIn Qt5 there's
qt5_add_translation
which converts .ts to .qm files, but the qm files then have to be manually added as dependencies to the target: https://doc.qt.io/qt-5/qtlinguist-cmake-qt5-add-translation.html