Don't try to install Qt plugins outside of the install prefix
Even if QMake tells us that would be the right location because it breaks development setups which use a custom install prefix and set QT_PLUGIN_PATH accordingly.
This commit is contained in:
parent
fc9e1ff703
commit
869a3b2ae2
|
@ -382,12 +382,22 @@ if (NOT META_NO_INSTALL_TARGETS AND ENABLE_INSTALL_TARGETS)
|
||||||
query_qmake_variable(QT_INSTALL_PLUGINS)
|
query_qmake_variable(QT_INSTALL_PLUGINS)
|
||||||
endif ()
|
endif ()
|
||||||
if (QT_INSTALL_PLUGINS)
|
if (QT_INSTALL_PLUGINS)
|
||||||
set(LIBRARY_DESTINATION ${QT_INSTALL_PLUGINS})
|
string(FIND "${QT_INSTALL_PLUGINS}" "${CMAKE_INSTALL_PREFIX}"
|
||||||
else ()
|
CMAKE_INSTALL_PREFIX_INDEX_IN_QT_INSTALL_PLUGINS)
|
||||||
|
if ("${CMAKE_INSTALL_PREFIX_INDEX_IN_QT_INSTALL_PLUGINS}" EQUAL 0)
|
||||||
|
set(LIBRARY_DESTINATION ${QT_INSTALL_PLUGINS})
|
||||||
|
else ()
|
||||||
|
message(
|
||||||
|
WARNING
|
||||||
|
"According to qmake the Qt plugin directory is \"${QT_INSTALL_PLUGINS}\". However, that path is not within the install prefix \"${CMAKE_INSTALL_PREFIX}\" and therefore ignored."
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
if (NOT LIBRARY_DESTINATION)
|
||||||
set(LIBRARY_DESTINATION lib${SELECTED_LIB_SUFFIX}/qt/plugins)
|
set(LIBRARY_DESTINATION lib${SELECTED_LIB_SUFFIX}/qt/plugins)
|
||||||
message(
|
message(
|
||||||
WARNING
|
WARNING
|
||||||
"Unable to detect appropriate install directory for Qt plugins (assuming \"${LIBRARY_DESTINATION}\")."
|
"Unable to detect appropriate install directory for Qt plugins (assuming \"${LIBRARY_DESTINATION}\"). Set QT_PLUGIN_DIR to specify the directory to install Qt plugins to manually."
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue