Set up mocwrapper
For the license checks to work, replace the Meta-Object Compiler (moc) with mocwrapper
. This means that the Qt build system calls mocwrapper
to handle license checks instead of moc
. If the license already exists in the local license cache, the process is quick. If it doesn't, Qt License Server obtains the license and caches it on the local disk for quicker access.
Note: These steps are necessary only if you install Qt License Service manually or if the mocwrapper
integration is not included in your Qt version (available in Qt 6.8.1 or later).
Obtain mocwrapper
To obtain mocwrapper
, install Qt License Service or Qt. Then find mocwrapper
from the following locations depending on your installation method.
Installation | Location |
---|---|
Qt License Service | LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<operating system>/mocwrapper |
Qt | Qt 6: <Qt version>/gcc_64/libexec/mocwrapper Qt 5: |
Replace moc
with mocwrapper
To replace moc
with mocwrapper
:
- Ensure you're in the correct directory:
- Qt6:
cd <your Qt Framework installation path>/libexec
- Qt5:
cd <your Qt Framework installation path>/bin
- Qt6:
- Rename
moc
toqtmoc
:mv moc qtmoc
- Copy
mocwrapper
to the directory you're in:cp LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/mocwrapper moc
- Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.
- Ensure you're in the correct directory:
- Qt6:
cd <your Qt Framework installation path>/libexec
- Qt5:
cd <your Qt Framework installation path>/bin
- Qt6:
- Rename
moc
toqtmoc
:mv moc qtmoc
- Copy
mocwrapper
to the directory you're in:cp LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/mocwrapper moc
- Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.
- Ensure you're in the correct directory:
cd <your Qt Framework installation path>\bin
- Rename
moc
toqtmoc
:move moc.exe qtmoc.exe
- Copy
mocwrapper
to the directory you're in:cp LicenseManagementTools\QtLicenseServer\<version>\QtLicenseService\<platform>\mocwrapper.exe moc.exe
- Build any Qt application with any IDE or from the command line to ensure that you set the installation path correctly.
Verify the mocwrapper
version
To verify which version of mocwrapper
you have:
./mocwrapper --mocwrapper-version
./mocwrapper --mocwrapper-version
.\mocwrapper.exe --mocwrapper-version
Disable legacy license check for Qt 5
To disable legacy support for the Qt 5 qmake licensing system, replace the licheck
binary with the provided one:
In <your Qt Framework installation path>/bin
:
- Back up the original
licheck
with any name:cp licheck licheck.bak
- Copy
licheck
replacement into its place:cp /LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/licheck licheck
In <your Qt Framework installation path>/bin
:
- Back up the original
licheck
with any name:cp licheck licheck.bak
- Copy
licheck
replacement into its place:cp /LicenseManagementTools/QtLicenseServer/<version>/QtLicenseService/<platform>/licheck licheck
In <your Qt Framework installation path>/bin
:
- Back up the original
licheck
with any name:move licheck.exe licheck_bak.exe
- Copy
licheck
replacement into its place:copy LicenseManagementTools\QtLicenseServer\<version>\QtLicenseService\<platform>\licheck.exe .
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.