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

CMake complains about missing PlatformGraphics module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.8.1
    • Build System: CMake
    • None
    • Windows 11, CMake
    • Android
    • f9a05c7cae10c05b701003f8ed848d0bfef8290a(dev)

    Description

      When configuring a project with Qt 6.8.1 for Android, CMake complains about a PlatformGraphics module not being found.

       

      All Qt 6.8.1 modules are installed on my system, using the regular Qt Online installer.

       

      This is the output from running CMake on a completely new and unchanged Android project when configuring it using Qt 6.8.1:

      [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S R:/Documents/qt681_PlatformGraphics_test -B R:/Documents/qt681_PlatformGraphics_test/build/Android_Qt_6_8_1_Clang_x86-Debug "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.8.1/android_x86/bin/qmake.bat" "-DQT_HOST_PATH:PATH=C:/Qt/6.8.1/mingw_64" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.8.1/android_x86" "-DQT_USE_TARGET_ANDROID_BUILD_DIR:BOOL=ON" "-DQT_NO_GLOBAL_APK_TARGET_PART_OF_ALL:BOOL=ON" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe" "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/build/cmake/android.toolchain.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DANDROID_SDK_ROOT:PATH=C:/Users/MyUsername/AppData/Local/Android/Sdk" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_FIND_ROOT_PATH:PATH=C:/Qt/6.8.1/android_x86" "-DANDROID_PLATFORM:STRING=android-23" "-DCMAKE_C_COMPILER:FILEPATH=C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe" "-DANDROID_ABI:STRING=x86" "-DANDROID_USE_LEGACY_TOOLCHAIN_FILE:BOOL=OFF" "-DANDROID_STL:STRING=c++_shared" "-DANDROID_NDK:PATH=C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=R:\Documents\qt681_PlatformGraphics_test\build\Android_Qt_6_8_1_Clang_x86-Debug/.qtc/package-manager/auto-setup.cmake" in R:\Documents\qt681_PlatformGraphics_test\build\Android_Qt_6_8_1_Clang_x86-Debug.
      [cmake] -- Android: Targeting API '23' with architecture 'x86', ABI 'x86', and processor 'i686'
      [cmake] -- Android: Selected unified Clang toolchain
      [cmake] -- The CXX compiler identification is Clang 17.0.2
      [cmake] -- Detecting CXX compiler ABI info
      [cmake] -- Detecting CXX compiler ABI info - done
      [cmake] -- Check for working CXX compiler: C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
      [cmake] -- Detecting CXX compile features
      [cmake] -- Detecting CXX compile features - done
      [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
      [cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
      [cmake] -- Check if compiler accepts -pthread
      [cmake] -- Check if compiler accepts -pthread - yes
      [cmake] -- Found Threads: TRUE
      [cmake] -- Performing Test HAVE_STDATOMIC
      [cmake] -- Performing Test HAVE_STDATOMIC - Success
      [cmake] -- Found WrapAtomic: TRUE
      [cmake] CMake Warning at C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake:123 (find_package):
      [cmake]   By not providing "FindPlatformGraphics.cmake" in CMAKE_MODULE_PATH this
      [cmake]   project has asked CMake to find a package configuration file provided by
      [cmake]   "PlatformGraphics", but CMake did not find one.
      [cmake] 
      [cmake]   Could not find a package configuration file provided by "PlatformGraphics"
      [cmake]   with any of the following names:
      [cmake] 
      [cmake]     PlatformGraphicsConfig.cmake
      [cmake]     platformgraphics-config.cmake
      [cmake] 
      [cmake]   Add the installation prefix of "PlatformGraphics" to CMAKE_PREFIX_PATH or
      [cmake]   set "PlatformGraphics_DIR" to a directory containing one of the above
      [cmake]   files.  If "PlatformGraphics" provides a separate development package or
      [cmake]   SDK, be sure it has been installed.
      [cmake] Call Stack (most recent call first):
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/FindGLESv2.cmake:13 (find_package)
      [cmake]   C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Gui/Qt6GuiDependencies.cmake:36 (_qt_internal_find_third_party_dependencies)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake:43 (include)
      [cmake]   C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:143 (find_dependency)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Quick/Qt6QuickDependencies.cmake:43 (_qt_internal_find_qt_dependencies)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake:43 (include)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/Qt6Config.cmake:181 (find_package)
      [cmake]   CMakeLists.txt:7 (find_package)
      [cmake] 
      [cmake] 
      [cmake] -- Performing Test HAVE_EGL
      [cmake] -- Performing Test HAVE_EGL - Success
      [cmake] -- Found EGL: C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include (found version "1.5")
      [cmake] CMake Warning at C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/FindGLESv2.cmake:24 (find_package):
      [cmake]   By not providing "FindPlatformGraphics.cmake" in CMAKE_MODULE_PATH this
      [cmake]   project has asked CMake to find a package configuration file provided by
      [cmake]   "PlatformGraphics", but CMake did not find one.
      [cmake] 
      [cmake]   Could not find a package configuration file provided by "PlatformGraphics"
      [cmake]   with any of the following names:
      [cmake] 
      [cmake]     PlatformGraphicsConfig.cmake
      [cmake]     platformgraphics-config.cmake
      [cmake] 
      [cmake]   Add the installation prefix of "PlatformGraphics" to CMAKE_PREFIX_PATH or
      [cmake]   set "PlatformGraphics_DIR" to a directory containing one of the above
      [cmake]   files.  If "PlatformGraphics" provides a separate development package or
      [cmake]   SDK, be sure it has been installed.
      [cmake] Call Stack (most recent call first):
      [cmake]   C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Gui/Qt6GuiDependencies.cmake:36 (_qt_internal_find_third_party_dependencies)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake:43 (include)
      [cmake]   C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:143 (find_dependency)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Quick/Qt6QuickDependencies.cmake:43 (_qt_internal_find_qt_dependencies)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6Quick/Qt6QuickConfig.cmake:43 (include)
      [cmake]   C:/Qt/6.8.1/android_x86/lib/cmake/Qt6/Qt6Config.cmake:181 (find_package)
      [cmake]   CMakeLists.txt:7 (find_package)
      [cmake] 
      [cmake] 
      [cmake] -- Performing Test HAVE_GLESv2
      [cmake] -- Performing Test HAVE_GLESv2 - Success
      [cmake] -- Found GLESv2: C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include
      [cmake] -- Found WrapVulkanHeaders: C:/Users/MyUsername/AppData/Local/Android/Sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include
      [cmake] -- Configuring 'appqt681_PlatformGraphics_test' for the following Android ABIs: x86 (default)
      [cmake] -- Found android platform plugin at: C:/Qt/6.8.1/android_x86/plugins/platforms/libplugins_platforms_qtforandroid_x86.so
      [cmake] -- Configuring done (3.6s)
      [cmake] -- Generating done (0.0s)
      [cmake] -- Build files have been written to: R:/Documents/qt681_PlatformGraphics_test/build/Android_Qt_6_8_1_Clang_x86-Debug
      [cmake] 
      [cmake] Elapsed time: 00:04. 

      This can be reproduced by simply creating a new Qt Quick project and configuring it with Qt 6.8.1 and an NDK version 26.x.xxxxxxxx

      I tested this with NDK versions 26.1.10909125 and 26.3.11579264- it happens with both.

      It still compiles and runs, but maybe those warnings should be investigated and fixed.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            lugotal Lukas Gottschald
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes