-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.6.0
The CMake manual does not cover the installation of custom QtDesigner plugins. FindQt4 used to supply the QT_PLUGINS_DIR variable, but there doesn't seem to exist a Qt5 equivalent. I ended up doing the following, which may be worth including in the manual:
#Install the designer plugin
if(QT_PLUGINS_DIR)
# Legacy FindQt4.
install(TARGETS ${Library}
RUNTIME DESTINATION "${QT_PLUGINS_DIR}/designer"
)
else()
# Call qmake to query the plugin installation directory.
get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake LOCATION)
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS
OUTPUT_VARIABLE QT_INSTALL_PLUGINS OUTPUT_STRIP_TRAILING_WHITESPACE
)
install(TARGETS ${Library}
RUNTIME DESTINATION "${QT_INSTALL_PLUGINS}/designer"
)
endif()
Better yet, Qt's CMake files could reintroduce the QT_PLUGINS_DIR. Anyway, it should be documented.
- relates to
-
QTBUG-75867 No cmake target for Qt5::DesignerComponents is exported
-
- Closed
-