Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113802

CrossBuilding QtPdf fails because of wrong path to qt.toolchain.cmake

    XMLWordPrintable

Details

    • d50c5f3b6 (dev), 193cf1584 (6.5)

    Description

      I try to cross-build QtPdf for Android

      It works fine if the host build is not installed in custom install dirs. However as soon as it is installed in a custom dir, the build fails with this error:

      FAILED: qtwebengine/src/host/src/hostBuild-stamp/hostBuild-configure /mnt/packages/git_repos/dpkg/qt-android/debian/build-qtpdf-x86/qtwebengine/src/host/src/hostBuild-stamp/hostBuild-configure 
      cd /mnt/packages/git_repos/dpkg/qt-android/debian/build-qtpdf-x86/qtwebengine/src/host && /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/usr/lib/cmake/Qt6/qt.toolchain.cmake -DWEBENGINE_ROOT_BUILD_DIR=/mnt/packages/git_repos/dpkg/qt-android/debian/build-qtpdf-x86/qtwebengine -DWEBENGINE_ROOT_SOURCE_DIR=/mnt/packages/git_repos/dpkg/qt-android/qtwebengine -DGN_TARGET_CPU=i386 -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= -DQT_FEATURE_qtwebengine_build=OFF -DQT_FEATURE_qtpdf_build=ON -GNinja /mnt/packages/git_repos/dpkg/qt-android/qtwebengine/src/host && /usr/bin/cmake -E touch /mnt/packages/git_repos/dpkg/qt-android/debian/build-qtpdf-x86/qtwebengine/src/host/src/hostBuild-stamp/hostBuild-configure
      CMake Error at /usr/share/cmake-3.25/Modules/CMakeDetermineSystem.cmake:130 (message):
        Could not find toolchain file: /usr/lib/cmake/Qt6/qt.toolchain.cmake
      Call Stack (most recent call first):
        CMakeLists.txt:18 (project)
      CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
       

      Patch could be:

      --- a/qtwebengine/src/CMakeLists.txt
      +++ b/qtwebengine/src/CMakeLists.txt
      @@ -169,7 +169,7 @@
               PREFIX      host
               USES_TERMINAL_BUILD TRUE
               EXCLUDE_FROM_ALL TRUE
      -        CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH}/lib/cmake/Qt6/qt.toolchain.cmake
      +        CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${QT_HOST_PATH_CMAKE_DIR}/Qt6/qt.toolchain.cmake
                          -DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
                          -DWEBENGINE_ROOT_SOURCE_DIR=${WEBENGINE_ROOT_SOURCE_DIR}
                          -DGN_TARGET_CPU=${TEST_architecture_arch}
       

      The host build was configured this way:

      cd debian/build-host && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu --log-level=STATUS -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_BINDIR=lib/qt-android-6.5-host/bin -DINSTALL_LIBDIR=lib/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_LIBEXECDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/libexec -DINSTALL_ARCHDATADIR=lib/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_EXAMPLESDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/examples -DINSTALL_DATADIR=share/qt-android-6.5-host -DINSTALL_DESCRIPTIONSDIR=share/qt-android-6.5-host/modules -DINSTALL_DOCDIR=share/qt-android-6.5-host/doc -DINSTALL_SYSCONFDIR=lib/qt-android-6.5-host/etc/xdg -DINSTALL_INCLUDEDIR=include/x86_64-linux-gnu/qt-android-6.5-host -DINSTALL_PLUGINSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/plugins -DINSTALL_TESTSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/tests -DINSTALL_TRANSLATIONSDIR=share/qt-android-6.5-host/translations -DINSTALL_MKSPECSDIR=lib/x86_64-linux-gnu/qt-android-6.5-host/mkspecs -DINSTALL_PUBLICBINDIR=lib/qt-android-6.5-host/bin -DBUILD_WITH_PCH=OFF -DBUILD_qt3d=OFF -DBUILD_qt5compat=OFF -DBUILD_qtactiveqt=OFF -DBUILD_qtbase=ON -DBUILD_qtcharts=OFF -DBUILD_qtcoap=OFF -DBUILD_qtconnectivity=OFF -DBUILD_qtdatavis3d=OFF -DBUILD_qtdeclarative=ON -DBUILD_qtdoc=OFF -DBUILD_qtgrpc=OFF -DBUILD_qthttpserver=OFF -DBUILD_qtimageformats=OFF -DBUILD_qtlanguageserver=OFF -DBUILD_qtlocation=OFF -DBUILD_qtlottie=OFF -DBUILD_qtmqtt=OFF -DBUILD_qtmultimedia=OFF -DBUILD_qtnetworkauth=OFF -DBUILD_qtopcua=OFF -DBUILD_qtpositioning=OFF -DBUILD_qtquick3d=ON -DBUILD_qtquick3dphysics=OFF -DBUILD_qtquickeffectmaker=OFF -DBUILD_qtquicktimeline=OFF -DBUILD_qtremoteobjects=ON -DBUILD_qtscxml=ON -DBUILD_qtsensors=OFF -DBUILD_qtserialbus=OFF -DBUILD_qtserialport=OFF -DBUILD_qtshadertools=ON -DBUILD_qtspeech=OFF -DBUILD_qtsvg=OFF -DBUILD_qttools=ON -DBUILD_qttranslations=OFF -DBUILD_qtvirtualkeyboard=OFF -DBUILD_qtwayland=OFF -DBUILD_qtwebchannel=OFF -DBUILD_qtwebengine=OFF -DBUILD_qtwebsockets=OFF -DBUILD_qtwebview=OFF -DFEATURE_accessibility=OFF -DFEATURE_assistant=ON -DFEATURE_brotli=OFF -DFEATURE_calendarwidget=ON -DFEATURE_concurrent=ON -DFEATURE_contextmenu=ON -DFEATURE_cssparser=ON -DFEATURE_cups=OFF -DFEATURE_cursor=ON -DFEATURE_dbus=OFF -DFEATURE_designer=OFF -DFEATURE_egl=OFF -DFEATURE_evdev=OFF -DFEATURE_fontconfig=OFF -DFEATURE_fontdialog=OFF -DFEATURE_freetype=OFF -DFEATURE_gif=OFF -DFEATURE_glib=OFF -DFEATURE_graphicseffect=OFF -DFEATURE_graphicsview=ON -DFEATURE_gssapi=OFF -DFEATURE_gtk3=OFF -DFEATURE_harfbuzz=OFF -DFEATURE_http=OFF -DFEATURE_ico=OFF -DFEATURE_icu=OFF -DFEATURE_islamiccivilcalendar=OFF -DFEATURE_jalalicalendar=OFF -DFEATURE_jpeg=OFF -DFEATURE_libinput=OFF -DFEATURE_libinput_hires_wheel_support=OFF -DFEATURE_linuxfb=OFF -DFEATURE_movie=OFF -DFEATURE_mtdev=OFF -DFEATURE_network=ON -DFEATURE_openssl=OFF -DFEATURE_pdf=ON -DFEATURE_pkg_config=OFF -DFEATURE_printsupport=ON -DFEATURE_qml_debug=ON -DFEATURE_qml_delegate_model=ON -DFEATURE_qml_devtools=ON -DFEATURE_qml_jit=OFF -DFEATURE_qml_list_model=OFF -DFEATURE_qml_locale=ON -DFEATURE_qml_network=ON -DFEATURE_qml_preview=OFF -DFEATURE_qml_profiler=OFF -DFEATURE_qml_worker_script=OFF -DFEATURE_qml_xml_http_request=OFF -DFEATURE_qml_xmllistmodel=OFF -DFEATURE_quick3d_assimp=OFF -DFEATURE_quick_designer=OFF -DFEATURE_quick_draganddrop=ON -DFEATURE_quick_particles=OFF -DFEATURE_quick_path=OFF -DFEATURE_quickcontrols2_basic=OFF -DFEATURE_quickcontrols2_fusion=OFF -DFEATURE_quickcontrols2_imagine=OFF -DFEATURE_quickcontrols2_ios=OFF -DFEATURE_quickcontrols2_macos=OFF -DFEATURE_quickcontrols2_material=OFF -DFEATURE_quickcontrols2_universal=OFF -DFEATURE_quickcontrols2_windows=OFF -DFEATURE_quicktemplates2_calendar=OFF -DFEATURE_quicktemplates2_hover=OFF -DFEATURE_quicktemplates2_multitouch=OFF -DFEATURE_regularexpression=ON -DFEATURE_scxml_ecmascriptdatamodel=OFF -DFEATURE_sessionmanager=OFF -DFEATURE_sql=ON -DFEATURE_sql_db2=OFF -DFEATURE_sql_ibase=OFF -DFEATURE_sql_mysql=OFF -DFEATURE_sql_oci=OFF -DFEATURE_sql_odbc=OFF -DFEATURE_sql_psql=OFF -DFEATURE_sql_sqlite=OFF -DFEATURE_sqlmodel=OFF -DFEATURE_ssl=OFF -DFEATURE_style_fusion=OFF -DFEATURE_style_stylesheet=ON -DFEATURE_style_windows=ON -DFEATURE_system_doubleconversion=ON -DFEATURE_system_libb2=ON -DFEATURE_system_pcre2=ON -DFEATURE_system_png=ON -DFEATURE_system_zlib=ON -DFEATURE_testlib=ON -DFEATURE_texthtmlparser=ON -DFEATURE_textmarkdownreader=OFF -DFEATURE_textmarkdownwriter=OFF -DFEATURE_textodfwriter=OFF -DFEATURE_tslib=OFF -DFEATURE_vnc=OFF -DFEATURE_vulkan=OFF -DFEATURE_widgets=ON -DFEATURE_xkbcommon=OFF -DFEATURE_xkbcommon_x11=OFF -DFEATURE_xlib=OFF -DFEATURE_xml=ON -DFEATURE_zstd=OFF -DINPUT_opengl=no -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON ../..
      

      The qtpdf cross-build is done with:

      cmake -B debian/build-qtpdf-$abi -S . --log-level=STATUS \
          -DCMAKE_INSTALL_PREFIX=/usr/lib/qt-android-6.5-$abi \
          -DBUILD_WITH_PCH=OFF \
          -DANDROID_SDK_ROOT=/opt/android-sdk \
          -DCMAKE_TOOLCHAIN_FILE=/opt/android-sdk/ndk/25.1.8937393//build/cmake/android.toolchain.cmake \
          -DANDROID_ABI=$abi \
          -DCMAKE_BUILD_TYPE=Release \
          -DBUILD_qtwayland=OFF \
          -DQT_HOST_PATH=/usr \
          -DQT_HOST_PATH_CMAKE_DIR=/usr/lib/x86_64-linux-gnu/qt-android-6.5-host/cmake \
          -GNinja \
          -DFEATURE_qtwebengine_build=OFF \
          -DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
      

      Attachments

        For Gerrit Dashboard: QTBUG-113802
        # Subject Branch Project Status CR V

        Activity

          People

            qtbuildsystem Qt Build System Team
            ban F S
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes