From b1f8ca8032bd0500f356c55c335937f7fb89d3f5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 Jul 2020 15:05:42 +0200 Subject: CMake: Fix various issues with the Android build Certain resources and compiled jar files have to be copied into the non-prefix build dir location. They were previously only installed, which doesn't do anything in a non-prefix build. Change pro2cmake to generate code that places the compiled java jars into QT_BUILD_DIR, so that non-prefix builds work. Place the module dependencies xml files into lib folder in non-prefix builds. Don't special case the output and install location of the Android QPA plugin. Task-number: QTBUG-85399 Change-Id: I4ac9d3929ea8ecc95ec99a77e621ad2121b68832 Reviewed-by: Joerg Bornemann --- src/android/jar/.prev_CMakeLists.txt | 1 + src/android/jar/CMakeLists.txt | 1 + src/android/java/CMakeLists.txt | 7 ++++--- src/android/templates/CMakeLists.txt | 11 +++++------ src/network/android/jar/CMakeLists.txt | 1 + src/plugins/platforms/android/CMakeLists.txt | 8 -------- 6 files changed, 12 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/android/jar/.prev_CMakeLists.txt b/src/android/jar/.prev_CMakeLists.txt index f4c807c33a..e09f318aac 100644 --- a/src/android/jar/.prev_CMakeLists.txt +++ b/src/android/jar/.prev_CMakeLists.txt @@ -21,6 +21,7 @@ set(java_sources add_jar(QtAndroid INCLUDE_JARS ${QT_ANDROID_JAR} SOURCES ${java_sources} + OUTPUT_DIR "${QT_BUILD_DIR}/jar" ) install_jar(QtAndroid diff --git a/src/android/jar/CMakeLists.txt b/src/android/jar/CMakeLists.txt index 61af168a67..c8beeba96d 100644 --- a/src/android/jar/CMakeLists.txt +++ b/src/android/jar/CMakeLists.txt @@ -22,6 +22,7 @@ set(java_sources add_jar(QtAndroid INCLUDE_JARS ${QT_ANDROID_JAR} SOURCES ${java_sources} + OUTPUT_DIR "${QT_BUILD_DIR}/jar" ) install_jar(QtAndroid diff --git a/src/android/java/CMakeLists.txt b/src/android/java/CMakeLists.txt index 1c24bd5e82..e9d72247dd 100644 --- a/src/android/java/CMakeLists.txt +++ b/src/android/java/CMakeLists.txt @@ -6,7 +6,8 @@ set(resource_directories res src) -qt_install(DIRECTORY ${resource_directories} - DESTINATION src/android/java - COMPONENT Devel) +qt_path_join(destination ${QT_INSTALL_DIR} "src/android/java") +qt_copy_or_install(DIRECTORY ${resource_directories} + DESTINATION "${destination}" +) # special case end diff --git a/src/android/templates/CMakeLists.txt b/src/android/templates/CMakeLists.txt index 8e007b7215..d0f1f4bf71 100644 --- a/src/android/templates/CMakeLists.txt +++ b/src/android/templates/CMakeLists.txt @@ -9,11 +9,10 @@ set(template_files set(template_directories res) -qt_install(FILES ${template_files} - DESTINATION src/android/templates - COMPONENT Devel) +qt_path_join(destination ${QT_INSTALL_DIR} "src/android/templates") +qt_copy_or_install(FILES ${template_files} + DESTINATION "${destination}") -qt_install(DIRECTORY ${template_directories} - DESTINATION src/android/templates - COMPONENT Devel) +qt_copy_or_install(DIRECTORY ${template_directories} + DESTINATION "${destination}") # special case end diff --git a/src/network/android/jar/CMakeLists.txt b/src/network/android/jar/CMakeLists.txt index 5b7c2d012b..48f3d35e6f 100644 --- a/src/network/android/jar/CMakeLists.txt +++ b/src/network/android/jar/CMakeLists.txt @@ -7,6 +7,7 @@ set(java_sources add_jar(QtAndroidNetwork INCLUDE_JARS ${QT_ANDROID_JAR} SOURCES ${java_sources} + OUTPUT_DIR "${QT_BUILD_DIR}/jar" ) install_jar(QtAndroidNetwork diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt index 2203842fe8..d3363de4c7 100644 --- a/src/plugins/platforms/android/CMakeLists.txt +++ b/src/plugins/platforms/android/CMakeLists.txt @@ -53,14 +53,6 @@ qt_internal_add_plugin(QAndroidIntegrationPlugin Qt::GuiPrivate android jnigraphics -# special case begin - INSTALL_DIRECTORY - plugins/platforms - OUTPUT_DIRECTORY - plugins/platforms - ARCHIVE_INSTALL_DIRECTORY - plugins/platforms -# special case end ) #### Keys ignored in scope 1:.:.:android.pro:: -- cgit v1.2.3