diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2013-05-31 18:37:39 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2013-06-07 14:46:22 +0300 |
commit | 042b189f6f01d89c88698c22e2b97dc27d626eb4 (patch) | |
tree | 0de4e07e4ee9ac531e9a4ebaeffc573b4c85b8eb | |
parent | c54b78996c5937bd11b925231f41c3ef771e41d8 (diff) |
qt5: Set QT_IMPORTS_DIR on qt5
-rw-r--r-- | cmake/modules/QtHelpers.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/modules/QtHelpers.cmake b/cmake/modules/QtHelpers.cmake index 66ac2b0..f186792 100644 --- a/cmake/modules/QtHelpers.cmake +++ b/cmake/modules/QtHelpers.cmake @@ -31,6 +31,20 @@ if (USE_QT5) set(QT_QTCORE_LIBRARY ${Qt5Core_LIBRARIES}) set(QT_QTGUI_LIBRARY ${Qt5Widgets_LIBRARIES}) set(QT_INCLUDE_DIR ${Qt5Widgets_INCLUDE_DIRS}) + + function(_QT5_QUERY_QMAKE VAR RESULT) + get_target_property(_QMAKE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) + execute_process(COMMAND "${_QMAKE}" -query ${VAR} + RESULT_VARIABLE return_code + OUTPUT_VARIABLE output + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) + if(NOT return_code) + file(TO_CMAKE_PATH "${output}" output) + set(${RESULT} ${output} PARENT_SCOPE) + endif() + endfunction() + + _qt5_query_qmake(QT_INSTALL_IMPORTS QT_IMPORTS_DIR) endif() find_package(Qt5Declarative) if (Qt5Declarative_FOUND) |