From e0cfec7848ba63190957e107c7ef32dbe0119c42 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Tue, 3 May 2016 17:00:24 +0200 Subject: Android deployment: support projects without things in share or lib/qml Just setting the field android-extra-plugins to an empty string resulted in androiddeployqt complaining about "External resource does not exist or not a correct directory!" so the field is completely left out now if no plugin data dirs are found. For consistency the same is done with the android-extra-libs field. REVIEW: 127700 BUG: 362578 Thanks apol for review --- toolchain/specifydependencies.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'toolchain/specifydependencies.cmake') diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake index 21b169ae..e01c61a7 100644 --- a/toolchain/specifydependencies.cmake +++ b/toolchain/specifydependencies.cmake @@ -16,7 +16,26 @@ foreach(lib IN LISTS outout) #now we filter Qt5 libraries, because Qt wants to t endif() endif() endforeach() +if(extralibs) + set(extralibs "\"android-extra-libs\": \"${extralibs}\",") +endif() + +set(extraplugins) +foreach(folder "share" "lib/qml") #now we check for folders with extra stuff + set(plugin "${EXPORT_DIR}/${folder}") + if(EXISTS "${plugin}") + if(extraplugins) + set(extraplugins "${extraplugins},${plugin}") + else() + set(extraplugins "${plugin}") + endif() + endif() +endforeach() +if(extraplugins) + set(extraplugins "\"android-extra-plugins\": \"${extraplugins}\",") +endif() file(READ "${INPUT_FILE}" CONTENTS) string(REPLACE "##EXTRALIBS##" "${extralibs}" NEWCONTENTS "${CONTENTS}") +string(REPLACE "##EXTRAPLUGINS##" "${extraplugins}" NEWCONTENTS "${NEWCONTENTS}") file(WRITE "${OUTPUT_FILE}" ${NEWCONTENTS}) -- cgit v1.2.1