summaryrefslogtreecommitdiff
path: root/Source/QtDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-30 10:43:51 -0400
committerBrad King <brad.king@kitware.com>2016-06-30 11:26:53 -0400
commit73a3c0cd9857b519350df09811f78c29e3fbd7be (patch)
tree0c50f92ad36732d4e109153315b0aa4b6ea11c6e /Source/QtDialog
parentb1883bc8b7bd4211037bcc181edffdcce646f43a (diff)
downloadcmake-73a3c0cd9857b519350df09811f78c29e3fbd7be.tar.gz
cmake-gui: Add build option to use Qt5 xcb plugin statically
This will enable builds against a static Qt5.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeLists.txt6
-rw-r--r--Source/QtDialog/CMakeSetup.cxx5
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 68c65ac0fb..80c0dc0e88 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -36,6 +36,12 @@ if (Qt5Widgets_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+ if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
+ list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
+ set_property(SOURCE CMakeSetup.cxx
+ PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin)
+ endif()
+
# 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
# Qt5 support is missing there.
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index c849d5292a..ff3a7b2ea8 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -20,6 +20,7 @@
#include <QDir>
#include <QLocale>
#include <QString>
+#include <QtPlugin>
#include <QTextCodec>
#include <QTranslator>
#include <cmsys/CommandLineArguments.hxx>
@@ -44,6 +45,10 @@ static int cmOSXInstall(std::string dir);
static void cmAddPluginPath();
#endif
+#if defined(USE_QXcbIntegrationPlugin)
+Q_IMPORT_PLUGIN(QXcbIntegrationPlugin);
+#endif
+
int main(int argc, char** argv)
{
cmsys::Encoding::CommandLineArguments encoding_args =