[Interest] Porting a previous qmake approach to cmake

Ulf Hermann ulf.hermann at qt.io
Fri Jan 13 17:38:42 CET 2023


Amir is trying to reproduce your problem. I can't figure out what is 
wrong there because I don't use macOS.

In the mean time, you can also just load your QML modules from the 
resource file system. Then they don't have to be present in the bundle's 
file system. To do that on 6.4 add

RESOURCE_PREFIX /qt/qml

to your qt_add_qml_module. Then add

engine->addImportPath(":/qt/qml")

to your C++. 6.5 spits out a warning if you don't set a resource prefix, 
it already has :/qt/qml as default import path and there is 
AUTO_RESOURCE_PREFIX.

Finally, make sure all the modules are linked into the application and 
that the linker drops none of them.

Copying the static libraries into the module directory is pointless 
because they cannot be loaded dynamically anyway.

Ulf


More information about the Interest mailing list