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

Qt6.1: qt-cmake fails to build example on Android

    XMLWordPrintable

Details

    Description

      Install Qt6.1.0 Android binaries on Windows10 (first online snapshot SHA1 9ab5968c18c68f3b23e64be3fe92f5e3c0da1aeb).

      Open command prompt, set env variables

      CMAKE_PREFIX_PATH=C:\Users\joaijala\RTA\qt5\6.1.0\android_arm64_v8a\lib\cmake

      PATH=C:\Users\joaijala\RTA\qt5\6.1.0\mingw81_64\bin;C:\Users\joaijala\RTA\qt5\6.1.0\android_arm64_v8a\bin;C:\Users\joaijala\RTA\qt5\Tools\CMake_64\bin;C:\Users\joaijala\RTA\qt5\Tools\Ninja;C:\Users\joaijala\RTA\qt5\Tools\mingw810_64\bin;%PATH%

      Using example Examples\Qt-6.1.0\quick3d\lights, compile/configure with command (it's all in one line, added line breaks for easier reading):

      C:\Users\joaijala\RTA\qt5\6.1.0\android_arm64_v8a\bin\qt-cmake
      
      -S C:\Users\joaijala\RTA\qt5\Examples\Qt-6.1.0\quick3d\lights
      
      -B C:\Users\joaijala\RTA\qt5\Examples\Qt-6.1.0\quick3d\lights\bld_arm64-v8a
      
      -DANDROID_SDK_ROOT:PATH=C:\Utils\Android\sdk\
      
      -DCMAKE_TOOLCHAIN_FILE:PATH=C:\Utils\Android\sdk\ndk\21.3.6528147\build\cmake\android.toolchain.cmake
      
      -GNinja
      

       6.1.0\android_arm64_v8a\lib\cmake\Qt6\qt.toolchain.cmake still mixes the path separators, but even if I change those to Windows style does not affect the issue

          set(__qt_initial_qt_host_path "C:\Users\joaijala\RTA\qt5/6.1.0/mingw81_64")
          if(NOT DEFINED QT_HOST_PATH AND EXISTS "${__qt_initial_qt_host_path}")
              set(QT_HOST_PATH "${__qt_initial_qt_host_path}" CACHE PATH "" FORCE)
          endif()    set(__qt_initial_qt_host_path_cmake_dir "C:\Users\joaijala\RTA\qt5/6.1.0/mingw81_64/lib/cmake")
          if(NOT DEFINED QT_HOST_PATH_CMAKE_DIR AND EXISTS "${__qt_initial_qt_host_path_cmake_dir}")
              set(QT_HOST_PATH_CMAKE_DIR "${__qt_initial_qt_host_path_cmake_dir}" CACHE PATH "" FORCE)
          endif()
      

      Also, the qt-cmake.bat had mixed path separators, but as above changing them to windows style does not affect the issue:

      @echo off
      :: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
      set script_dir_path=%~dp0
      :: Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
      set cmake_path=C:\Users\joaijala\RTA\qt5/Tools/CMake_64/bin/cmake.exe
      if not exist "%cmake_path%" set cmake_path=cmake
      set toolchain_path=%script_dir_path%/../lib/cmake/Qt6/qt.toolchain.cmake
      "%cmake_path%" -DCMAKE_TOOLCHAIN_FILE="%toolchain_path%"  %*
      

      Build fails with:

      CMake Warning at CMakeLists.txt:21 (find_package):
        By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
        asked CMake to find a package configuration file provided by "Qt6", but
        CMake did not find one.  Could not find a package configuration file provided by "Qt6" with any of
        the following names:    Qt6Config.cmake
          qt6-config.cmake  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
        to a directory containing one of the above files.  If "Qt6" provides a
        separate development package or SDK, be sure it has been installed.
      CMake Error at CMakeLists.txt:23 (qt_add_executable):
        Unknown CMake command "qt_add_executable".
      

      Full log attached, also the CMakeOutput.log

      If compiling without qt-cmake, compilation works fine:

      cmake.exe -S c:\Users\joaijala\RTA\qt5\Examples\Qt-6.1.0\quick3d\lights -B c:\Users\joaijala\RTA\qt5\Examples\Qt-6.1.0\quick3d\lights_bld_arm64 -GNinja -DQT_HOST_PATH:PATH=C:\Users\joaijala\RTA\qt5\6.1.0\mingw81_64 -DANDROID_SDK_ROOT=C:\Utils\Android\sdk -DCMAKE_TOOLCHAIN_FILE:PATH=C:\Utils\Android\sdk\ndk\21.1.6352462\build\cmake\android.toolchain.cmake -DCMAKE_FIND_ROOT_PATH:PATH=C:\Users\joaijala\RTA\qt5\6.1.0\android_arm64_v8a -DANDROID_NDK_ROOT=C:\Utils\Android\sdk\ndk\21.1.6352462 -DANDROID_ABI:STRING=arm64-v8a
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              aksalova Akseli Salovaara
              joaijala Johanna Äijälä
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes