diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2015-07-24 07:15:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-27 14:21:10 (GMT) |
commit | 42f0155bb9f7cb65c7af103ec1170f4193244d69 (patch) | |
tree | 7a8f0aeaf03c79d3c6765f06ca0538eba5b486c4 /Source/QtDialog | |
parent | d546133d49432d24561760730b6e09213b5d136c (diff) | |
download | CMake-42f0155bb9f7cb65c7af103ec1170f4193244d69.zip CMake-42f0155bb9f7cb65c7af103ec1170f4193244d69.tar.gz CMake-42f0155bb9f7cb65c7af103ec1170f4193244d69.tar.bz2 |
cmake-gui: Install Qt5 Windows platform plugin
Qt5 requires a platform-specific runtime-loaded plugin. We already
install it for OS X. Install it for Windows too.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 038c411..ba993eb 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -36,17 +36,22 @@ if (Qt5Widgets_FOUND) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - # We need to install Cocoa platform plugin and add qt.conf for Qt5 on Mac. + # 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 Mac support is missing there. - if(APPLE) + # Qt5 support is missing there. + if(APPLE OR WIN32) macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) if(EXISTS "${_qt_plugin_path}") get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) - set(_qt_plugin_dest "PlugIns/${_qt_plugin_type}") + if(APPLE) + set(_qt_plugin_dir "PlugIns") + elseif(WIN32) + set(_qt_plugin_dir "plugins") + endif() + set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") install(FILES "${_qt_plugin_path}" DESTINATION "${_qt_plugin_dest}" ${COMPONENT}) @@ -56,12 +61,21 @@ if (Qt5Widgets_FOUND) message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() endmacro() - install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = PlugIns\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" - ${COMPONENT}) + if(APPLE) + install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + ${COMPONENT}) + elseif(WIN32) + install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION bin + ${COMPONENT}) + endif() endif() if(WIN32 AND TARGET Qt5::Core) |