From 20385c84ff334f6d3481a699e7633051b4546c3f Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 00:15:58 +0200 Subject: [PATCH 1/6] Fix missing proj & qgis resources on android --- .gitignore | 12 ++++-------- CMakeLists.txt | 8 ++++---- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index afde8b635..7a87f8bad 100644 --- a/.gitignore +++ b/.gitignore @@ -11,17 +11,13 @@ 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/* +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..332d6d59b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,16 +380,16 @@ 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) +file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources) file(COPY ${QGIS_RESOURCE_DIR}/qgis.db - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/resources/ + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources/ ) file(COPY ${QGIS_RESOURCE_DIR}/srs.db - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/resources/ + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources/ ) file( COPY ${PROJ_DIR} - DESTINATION ${CMAKE_BINARY_DIR}/app/android/assets/qgis-data/ + DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/ PATTERN "*.cmake" EXCLUDE PATTERN "vcpkg*" EXCLUDE ) From 0548aaf95fb5adf3a3734436e9ec9f43add6c598 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 00:26:33 +0200 Subject: [PATCH 2/6] Fix ios proj & qgis resources path --- app/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index e057f2baf..d6c218c56 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -363,14 +363,14 @@ endif () if (IOS) # qgis resources - set(IOS_CRS_DIR ${CMAKE_CURRENT_BINARY_DIR}/android/assets/qgis-data/resources) + set(IOS_CRS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources) target_sources(MerginMaps PRIVATE ${IOS_CRS_DIR}) set_source_files_properties( ${IOS_CRS_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data ) # proj - set(IOS_PROJ_DIR ${CMAKE_CURRENT_BINARY_DIR}/android/assets/qgis-data/proj) + set(IOS_PROJ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/proj) target_sources(MerginMaps PRIVATE ${IOS_PROJ_DIR}) set_source_files_properties( ${IOS_PROJ_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data From 75b3e7bd6f716aae60429a1e12031259bb90fe02 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 00:29:29 +0200 Subject: [PATCH 3/6] Fix duplicate gitignore path --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7a87f8bad..c4b695b88 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ input.pro.user* app/android/assets app/android/AndroidManifest.xml app/android/build.gradle -app/android/.gradle/* app/android/.gradle *.gpkg-wal *.gpkg-shm From 19efb56b946d5864e2185fbf419ae3fd6481ef5a Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 00:44:22 +0200 Subject: [PATCH 4/6] Fix ios path --- app/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d6c218c56..0bdf4c33e 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -363,14 +363,14 @@ endif () if (IOS) # qgis resources - set(IOS_CRS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources) + set(IOS_CRS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android/assets/qgis-data/resources) target_sources(MerginMaps PRIVATE ${IOS_CRS_DIR}) set_source_files_properties( ${IOS_CRS_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data ) # proj - set(IOS_PROJ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/proj) + set(IOS_PROJ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android/assets/qgis-data/proj) target_sources(MerginMaps PRIVATE ${IOS_PROJ_DIR}) set_source_files_properties( ${IOS_PROJ_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data From e1d035f72e43906270ed60ce4c2cbe6078da9be7 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 09:23:15 +0200 Subject: [PATCH 5/6] Fix proj assets Path --- CMakeLists.txt | 17 +++++++++++++---- app/CMakeLists.txt | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 332d6d59b..0c5801f5a 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_CURRENT_SOURCE_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_CURRENT_SOURCE_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_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/resources/ + DESTINATION ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/resources/ ) file( COPY ${PROJ_DIR} - DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/app/android/assets/qgis-data/ + DESTINATION ${ASSETS_DIR_PATH}/app/android/assets/qgis-data/ PATTERN "*.cmake" EXCLUDE PATTERN "vcpkg*" EXCLUDE ) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 0bdf4c33e..e057f2baf 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -363,14 +363,14 @@ endif () if (IOS) # qgis resources - set(IOS_CRS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android/assets/qgis-data/resources) + set(IOS_CRS_DIR ${CMAKE_CURRENT_BINARY_DIR}/android/assets/qgis-data/resources) target_sources(MerginMaps PRIVATE ${IOS_CRS_DIR}) set_source_files_properties( ${IOS_CRS_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data ) # proj - set(IOS_PROJ_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android/assets/qgis-data/proj) + set(IOS_PROJ_DIR ${CMAKE_CURRENT_BINARY_DIR}/android/assets/qgis-data/proj) target_sources(MerginMaps PRIVATE ${IOS_PROJ_DIR}) set_source_files_properties( ${IOS_PROJ_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/qgis-data From 69f31f22589ef0f16260d56eb838de3def00e975 Mon Sep 17 00:00:00 2001 From: Matej Bagar Date: Wed, 15 Oct 2025 09:51:46 +0200 Subject: [PATCH 6/6] Format cmake --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c5801f5a..427d6abfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,9 +381,9 @@ endif () # ######################################################################################## message(STATUS "Copying proj and qgis resources to android/assets/qgis-data") -# 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) +# 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})