aboutsummaryrefslogtreecommitdiff
path: root/toolchain/specifydependencies.cmake
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-10-01 01:25:03 +0200
committerAleix Pol <aleixpol@kde.org>2015-10-01 01:25:03 +0200
commit3b20ef911eb83b7bd37315ace682e0e6bc6195d9 (patch)
tree610f42d8ea9a803b4b905e2fd4dea65764829d46 /toolchain/specifydependencies.cmake
parent1c20edb86115ecf788f64cb8563b85129c7a669d (diff)
downloadextra-cmake-modules-3b20ef911eb83b7bd37315ace682e0e6bc6195d9.tar.gz
extra-cmake-modules-3b20ef911eb83b7bd37315ace682e0e6bc6195d9.tar.bz2
Remove workaround to delay execution on Android
* Remove get_property calls on targets, this way we don't need to be called right before configuration time. * Removes EOFHook Instead we process it at generation time using the link.txt file (which is probably another hack) REVIEW: 125084
Diffstat (limited to 'toolchain/specifydependencies.cmake')
-rw-r--r--toolchain/specifydependencies.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/toolchain/specifydependencies.cmake b/toolchain/specifydependencies.cmake
new file mode 100644
index 00000000..21b169ae
--- /dev/null
+++ b/toolchain/specifydependencies.cmake
@@ -0,0 +1,22 @@
+file(READ "${TARGET_DIR}/CMakeFiles/${TARGET_NAME}.dir/link.txt" out)
+
+string(FIND "${out}" "-o ${TARGET_NAME}" POS) #we trim the initial arguments, we want the ones in the end. we find the target
+string(SUBSTRING "${out}" ${POS} -1 out) #we
+string(REGEX MATCHALL " /.+\\.so" outout "${out}")
+string(STRIP "${outout}" outout)
+string(REPLACE " /" ";/" outout "${outout}")
+
+set(extralibs)
+foreach(lib IN LISTS outout) #now we filter Qt5 libraries, because Qt wants to take care about these itself
+ if(NOT ${lib} MATCHES ".*/libQt5.*")
+ if(extralibs)
+ set(extralibs "${extralibs},${lib}")
+ else()
+ set(extralibs "${lib}")
+ endif()
+ endif()
+endforeach()
+
+file(READ "${INPUT_FILE}" CONTENTS)
+string(REPLACE "##EXTRALIBS##" "${extralibs}" NEWCONTENTS "${CONTENTS}")
+file(WRITE "${OUTPUT_FILE}" ${NEWCONTENTS})