From 0bd53c77b506a241fb7a56ebf55ff13861f8c6bd Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 27 Feb 2019 21:04:06 +0100 Subject: [PATCH] Query install directory for Qt plugins from qmake --- CMakeLists.txt | 2 +- cmake/modules/LibraryTarget.cmake | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9def3ed..a9804bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ set(META_APP_DESCRIPTION "Useful C++ classes and routines such as argument parse set(META_FEATURES_FOR_COMPILER_DETECTION_HEADER cxx_thread_local) set(META_VERSION_MAJOR 4) set(META_VERSION_MINOR 17) -set(META_VERSION_PATCH 0) +set(META_VERSION_PATCH 1) # find required 3rd party libraries include(3rdParty) diff --git a/cmake/modules/LibraryTarget.cmake b/cmake/modules/LibraryTarget.cmake index 6152165..e3a0ada 100644 --- a/cmake/modules/LibraryTarget.cmake +++ b/cmake/modules/LibraryTarget.cmake @@ -376,7 +376,15 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS) if (QT_PLUGIN_DIR) set(LIBRARY_DESTINATION ${QT_PLUGIN_DIR}) else () - set(LIBRARY_DESTINATION lib${SELECTED_LIB_SUFFIX}/qt/plugins) + if (COMMAND query_qmake_variable) + query_qmake_variable(QT_INSTALL_PLUGINS) + endif() + if (QT_INSTALL_PLUGINS) + set(LIBRARY_DESTINATION ${QT_INSTALL_PLUGINS}) + else() + set(LIBRARY_DESTINATION lib${SELECTED_LIB_SUFFIX}/qt/plugins) + message(WARNING "Unable to detect appropriate install directory for Qt plugins (assuming \"${LIBRARY_DESTINATION}\").") + endif() endif () if (META_PLUGIN_CATEGORY) set(LIBRARY_DESTINATION ${LIBRARY_DESTINATION}/${META_PLUGIN_CATEGORY})