OlivierLDff / QtIosCMake

📱 Deploy Qt Application for iOS with a single macro when using CMake.
BSD 3-Clause "New" or "Revised" License
58 stars 15 forks source link

How to run Qt Application? #4

Closed davemilter closed 4 years ago

davemilter commented 4 years ago

I read #1 and tried this code:

https://github.com/davemilter/qt_ios_libs_bug/blob/run-app/CMakeLists.txt

It compiled just fine, foo_plugin_import.cpp and foo_qml_plugin_import.cpp generated.

But then application right after start closed on my iPad.

2020-04-22 00:40:14.902733+0300 foo[974:204514] [DYMTLInitPlatform] platform initialization successful
QML debugging is enabled. Only use this in a safe environment.
2020-04-22 00:40:15.134109+0300 foo[974:204247] QQmlApplicationEngine failed to load component
2020-04-22 00:40:15.134774+0300 foo[974:204247] qrc:/main.qml:4 module "QtQml.Models" is not installed
qrc:/main.qml:6 module "QtQuick.Layouts" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:3 module "QtQuick.Controls" is not installed
qrc:/main.qml:5 module "QtQuick.Dialogs" is not installed
qrc:/main.qml:7 module "QtQuick.Window" is not installed
qrc:/main.qml:2 module "QtQuick.Controls" is not installed
qrc:/main.qml:4 module "QtQml.Models" is not installed
qrc:/main.qml:6 module "QtQuick.Layouts" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:3 module "QtQuick.Controls" is not installed
qrc:/main.qml:5 module "QtQuick.Dialogs" is not installed
qrc:/main.qml:7 module "QtQuick.Window" is not installed

the whole code is here: https://github.com/davemilter/qt_ios_libs_bug/

Branch run-app .

Is I missed something?

Qt installed via online Installer. I can run qmake based project just fine via Qt Creator.

cmake -DCMAKE_PREFIX_PATH=/Users/user/Qt/5.12.7/ios -DDEPLOYMENT_TARGET=11.0 -DCMAKE_TOOLCHAIN_FILE=../IosCMakeToolchain/ios.toolchain.cmake -DPLATFORM=OS64 -DENABLE_BITCODE=FALSE -G "Xcode" ..

Or this issue should be here: https://github.com/OlivierLDff/QtStaticCMake ?

OlivierLDff commented 4 years ago

There were issue with QtStaticCMake that would make it work only with qt ios. Last version i checked working with ios was 2eccfda5968c60024712d9a050bf34f6cfb662d1. I'm currently solving issue https://github.com/OlivierLDff/QtStaticCMake/issues/4 from QtStaticCMake. When it will be fixed i will retry to look at your app. And even create a sample hello world qt ios project. Current issue that you have is that your wasn't linked to required libraries in qml/ folder. foo_qml_plugin_import.cpp should force linking to those libraries. Can you dump the content of this file?

OlivierLDff commented 4 years ago

You can check https://github.com/OlivierLDff/QQuickStaticHelloWorld/commit/5e7ef123c8fed052edc4b3f17d4c2ab8f1a25a58 Tell me if you manage to make it work. It is working with Qt5.12.3 for me from official installer.

I added better support for call of add_qt_ios_appwithout parameters in
https://github.com/OlivierLDff/QtIosCMake/commit/0fe568fb10c433fcc8123489a8bf2f0e807d9df0

davemilter commented 4 years ago

Thank you for example, @OlivierLDff !