Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Add AndroidManifest.xml in cmake
Qt 6.11 is out! See what's new in the release blog

Add AndroidManifest.xml in cmake

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mihaill
    wrote on last edited by Mihaill
    #1

    Hi!
    How add AndroidManifest.xml in cmake? I use Qt 6.
    Not work:

    set(ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/android CACHE INTERNAL "")
    
    set(ANDROID_BUID_DIR ${CMAKE_CURRENT_BINARY_DIR}/android-build)
    #...
    file(INSTALL android/ DESTINATION ${ANDROID_BUID_DIR} FILES_MATCHING PATTERN "*")
    
            set_target_properties(qtodo PROPERTIES
                QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android"
            )
    
    set(ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/android CACHE INTERNAL "")
    
    
    set(PROJECT_SOURCES
            android/AndroidManifest.xml
            main.cpp
            structures.h
            appcore.h appcore.cpp
            dbworker.h dbworker.cpp
            qml.qrc
    )
    
    1 Reply Last reply
    1
    • T Offline
      T Offline
      tinjapa
      wrote on last edited by
      #2

      Hello! You can use

      set_property(TARGET qtodo APPEND PROPERTY
          QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
      )
      

      to add the AndroidManifest.xml, assuming "qtodo" is the name of your target, and the AndroidManifest.xml file exists under ${CMAKE_CURRENT_SOURCE_DIR}/android. You can also have a look at https://doc.qt.io/qtcreator/qtcreator-accelbubble-example.html, which goes through the steps needed to create a Qt mobile app, including how to add the manifest file.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved