Add AndroidManifest.xml in cmake
Unsolved
Mobile and Embedded
-
wrote on 16 Jun 2022, 08:26 last edited by Mihaill
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 )
-
wrote on 29 Jun 2022, 09:27 last edited by
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.