How to compile Qt 6.4 for iOS from source
Solved
Mobile and Embedded
-
Hi,
I am trying to compile Qt 6.4 for iOS:
1.) Download and extract https://download.qt.io/official_releases/qt/6.4/6.4.0/single/qt-everywhere-src-6.4.0.tar.xz
2.) Run as described (https://doc.qt.io/qt-6/ios-building-from-source.html):
export PATH=$PATH:/Users/ham/Qt/Tools/Ninja export QT_HOST_PATH=/Users/ham/Desktop/qt/ios640 ./configure -platform macx-ios-clang -release -qt-host-path /Users/ham/Desktop/qt/ios640_host -prefix /Users/ham/Desktop/qt/ios640
But this results in the following error:
+ mkdir -p qtbase + cd qtbase + exec /Users/ham/Downloads/qt-everywhere-src-6.4.0/qtbase/configure -top-level -platform macx-ios-clang -release -qt-host-path /Users/ham/Desktop/qt/ios640_host -prefix /Users/ham/Desktop/qt/ios640 '/usr/local/Cellar/cmake/3.24.2/bin/cmake' '-DQT_HOST_PATH=/Users/ham/Desktop/qt/ios640_host' '-DCMAKE_INSTALL_PREFIX=/Users/ham/Desktop/qt/ios640' '-DQT_QMAKE_TARGET_MKSPEC=macx-ios-clang' '-DCMAKE_C_COMPILER=clang' '-DCMAKE_CXX_COMPILER=clang++' '-DCMAKE_SYSTEM_NAME=iOS' '-DCMAKE_BUILD_TYPE=Release' '-G' 'Ninja' '/Users/ham/Downloads/qt-everywhere-src-6.4.0' -- Using internal CMake iOS toolchain file. -- simulator_and_device set to: "ON". Checking dependencies of submodule 'qtbase' Checking dependencies of submodule 'qtimageformats' Checking dependencies of submodule 'qtlanguageserver' Checking dependencies of submodule 'qtshadertools' Checking dependencies of submodule 'qtsvg' Checking dependencies of submodule 'qtdeclarative' Checking dependencies of submodule 'qtmultimedia' Checking dependencies of submodule 'qt3d' Checking dependencies of submodule 'qt5compat' Checking dependencies of submodule 'qtactiveqt' Checking dependencies of submodule 'qtcharts' Checking dependencies of submodule 'qtcoap' Checking dependencies of submodule 'qtconnectivity' Checking dependencies of submodule 'qtdatavis3d' Checking dependencies of submodule 'qttools' Checking dependencies of submodule 'qtdoc' Checking dependencies of submodule 'qtwebsockets' Checking dependencies of submodule 'qthttpserver' Checking dependencies of submodule 'qtlottie' Checking dependencies of submodule 'qtmqtt' Checking dependencies of submodule 'qtnetworkauth' Checking dependencies of submodule 'qtopcua' Checking dependencies of submodule 'qtserialport' Checking dependencies of submodule 'qtpositioning' Checking dependencies of submodule 'qtquicktimeline' Checking dependencies of submodule 'qtquick3d' Checking dependencies of submodule 'qtquick3dphysics' Checking dependencies of submodule 'qtremoteobjects' Checking dependencies of submodule 'qtscxml' Checking dependencies of submodule 'qtsensors' Checking dependencies of submodule 'qtserialbus' Checking dependencies of submodule 'qtspeech' Checking dependencies of submodule 'qttranslations' Checking dependencies of submodule 'qtvirtualkeyboard' Checking dependencies of submodule 'qtwayland' Checking dependencies of submodule 'qtwebchannel' Checking dependencies of submodule 'qtwebengine' Checking dependencies of submodule 'qtwebview' Configuring submodule 'qtbase' CMake Error at qtbase/cmake/QtBuild.cmake:563 (message): You need to set QT_HOST_PATH to cross compile Qt. Call Stack (most recent call first): qtbase/cmake/QtSetup.cmake:274 (include) qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:237 (include) qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:382 (qt_build_internals_set_up_private_api) qtbase/CMakeLists.txt:109 (qt_build_repo_begin) -- Configuring incomplete, errors occurred! See also "/Users/ham/Downloads/qt-everywhere-src-6.4.0/CMakeFiles/CMakeOutput.log". See also "/Users/ham/Downloads/qt-everywhere-src-6.4.0/CMakeFiles/CMakeError.log". CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:965 (message): CMake exited with code 1.
Has someone an idea what causes the failure?
-
Hi,
From the looks of it, your
-qt-host-path
is wrong. It should point to a Qt build for the host machine. -
Thanks, got it working:
./configure -platform macx-ios-clang -release -qt-host-path /Users/ham/Qt/6.4.0/macos -prefix /Users/ham/Desktop/qt/ios640 -D QT_NO_MAKE_EXAMPLES=ON -skip qtquick3d -skip qtquick3dphysics -skip qtremoteobjects -skip qtscxml
Some packages, such as qtquick3d, qtscxml, etc., seem to require additional tools so I skipped them for now.
-
When cross-compiling I have a tendency to just build what I will need rather than absolutely everything.
-
This post is deleted!