mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmake-gui: Add build option to use Qt5 windows plugin statically
This will enable builds against a static Qt5 on Windows.
This commit is contained in:
@@ -33,6 +33,12 @@ if (Qt5Widgets_FOUND)
|
|||||||
PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
|
PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
|
||||||
|
list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES})
|
||||||
|
set_property(SOURCE CMakeSetup.cxx
|
||||||
|
PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
|
# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
|
||||||
# FIXME: This should be part of Qt5 CMake scripts, but unfortunatelly
|
# FIXME: This should be part of Qt5 CMake scripts, but unfortunatelly
|
||||||
# Qt5 support is missing there.
|
# Qt5 support is missing there.
|
||||||
@@ -65,7 +71,7 @@ if (Qt5Widgets_FOUND)
|
|||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
|
||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
|
||||||
${COMPONENT})
|
${COMPONENT})
|
||||||
elseif(WIN32)
|
elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
|
||||||
install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
|
install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
|
||||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf"
|
||||||
"[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
|
"[Paths]\nPlugins = ../${_qt_plugin_dir}\n")
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ static void cmAddPluginPath();
|
|||||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
|
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(USE_QWindowsIntegrationPlugin)
|
||||||
|
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
|
||||||
|
#endif
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
cmsys::Encoding::CommandLineArguments encoding_args =
|
cmsys::Encoding::CommandLineArguments encoding_args =
|
||||||
|
|||||||
Reference in New Issue
Block a user