diff --git a/.gitignore b/.gitignore index afde8b635..c4b695b88 100644 --- a/.gitignore +++ b/.gitignore @@ -11,17 +11,12 @@ core/merginsecrets.cpp test/temp_projects/ test/temp_extra_projects/ input.pro.user* -app/android/assets/qgis-data/proj_custom/ -app/android/assets/qgis-data/projects/ -app/android/assets/qgis-data/proj -app/android/assets/qgis-data/resources -app/android/assets/projects/ +app/android/assets app/android/AndroidManifest.xml +app/android/build.gradle +app/android/.gradle *.gpkg-wal *.gpkg-shm Input_keystore.keystore CMakeLists.txt.user -app/android/build.gradle -app/android/.gradle/* -app/android/.gradle .github/secrets/ios/LutraConsulting*.mobileprovision diff --git a/CMakeLists.txt b/CMakeLists.txt index 796643306..427d6abfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,16 +380,25 @@ endif () # RESOURCES # ######################################################################################## message(STATUS "Copying proj and qgis resources to android/assets/qgis-data") -file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/resources) + +# On android we need to copy the resources into the source tree and then Qt will copy it +# to the android build directory with QT_ANDROID_PACKAGE_SOURCE_DIR +if (ANDROID) + set(ASSETS_DIR_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +else () + set(ASSETS_DIR_PATH ${CMAKE_BINARY_DIR}) +endif () + +file(MAKE_DIRECTORY ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/resources) file(COPY ${QGIS_RESOURCE_DIR}/qgis.db - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/resources/ + DESTINATION ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/resources/ ) file(COPY ${QGIS_RESOURCE_DIR}/srs.db - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/resources/ + DESTINATION ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/resources/ ) file( COPY ${PROJ_DIR} - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/ + DESTINATION ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/ PATTERN "*.cmake" EXCLUDE PATTERN "vcpkg*" EXCLUDE )