From 96e7fb9969b761cce956a3500ede3b1c6cb29c65 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Wed, 3 Sep 2014 14:28:14 +0200 Subject: Fix ECM to use qmake instead of hardcoding plugin install dirs Packagers and other interested folks should pass -DKDE_INSTALL_USE_QT_SYS_PATHS=ON when building in order to install various files to the same dir as the Qt5 install dirs. CCMAIL: kde-packagers@kde.org REVIEW: 119901 --- modules/ECMQueryQmake.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 modules/ECMQueryQmake.cmake (limited to 'modules/ECMQueryQmake.cmake') diff --git a/modules/ECMQueryQmake.cmake b/modules/ECMQueryQmake.cmake new file mode 100644 index 00000000..5147fcc7 --- /dev/null +++ b/modules/ECMQueryQmake.cmake @@ -0,0 +1,15 @@ +find_package(Qt5Core QUIET) + +if (TARGET Qt5::qmake) + get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION) +else() + set(QMAKE_EXECUTABLE "qmake-qt5" CACHE) +endif() + +function(QUERY_QMAKE RESULT VAR) + exec_program(${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output ) + if(NOT return_code) + file(TO_CMAKE_PATH "${output}" output) + set(${RESULT} ${output} PARENT_SCOPE) + endif() +endfunction(QUERY_QMAKE) -- cgit v1.2.1