diff options
author | Alex Merry <alex.merry@kde.org> | 2014-09-11 21:00:00 +0100 |
---|---|---|
committer | Alex Merry <alex.merry@kde.org> | 2014-09-11 21:00:00 +0100 |
commit | f8609e8b64fd9170aa1444ad4e2f6d6d759e9050 (patch) | |
tree | 083c6d46b2d494bd6f8161e523d9dff82dadbc4a /modules | |
parent | 6ab50fa9e27c4710beb2641fd510dfce08cc2719 (diff) | |
download | extra-cmake-modules-f8609e8b64fd9170aa1444ad4e2f6d6d759e9050.tar.gz extra-cmake-modules-f8609e8b64fd9170aa1444ad4e2f6d6d759e9050.tar.bz2 |
Fix fallout from recent ECM patches
KDE modules cannot assume the normal ECM modules are in the CMake module
path, and CMAKE_INSTALL_IMPORTS_INSTALL_DIR / QTQUICKIMPORTSDIR was not
set correctly. Also, ECMQueryQmake.cmake used a deprecated CMake command
(exec_program).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ECMQueryQmake.cmake | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/ECMQueryQmake.cmake b/modules/ECMQueryQmake.cmake index 5147fcc7..ef9aaae0 100644 --- a/modules/ECMQueryQmake.cmake +++ b/modules/ECMQueryQmake.cmake @@ -6,10 +6,17 @@ 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) +# This is not public API (yet)! +function(query_qmake result_variable qt_variable) + execute_process( + COMMAND ${QMAKE_EXECUTABLE} -query "${qt_variable}" + RESULT_VARIABLE return_code + OUTPUT_VARIABLE output + ) + if(return_code EQUAL 0) + file(TO_CMAKE_PATH "${output}" output_path) + set(${result_variable} "${output_path}" PARENT_SCOPE) + else() + message(FATAL "QMake call failed: ${error}") endif() -endfunction(QUERY_QMAKE) +endfunction() |