diff options
author | Brad King <brad.king@kitware.com> | 2021-01-08 14:09:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-01-08 14:09:28 (GMT) |
commit | b7718ab6ca88262bc7586fc56b7c0d95590fbe4f (patch) | |
tree | b9bc0e2684b55d3b128dfe7f4049c2e64cb6085a | |
parent | 663258384802876f6f44ef21ea6ca6de3e83eac1 (diff) | |
parent | a6abe70e72141f03d284dfcc6559c2b4e2848b8e (diff) | |
download | CMake-b7718ab6ca88262bc7586fc56b7c0d95590fbe4f.zip CMake-b7718ab6ca88262bc7586fc56b7c0d95590fbe4f.tar.gz CMake-b7718ab6ca88262bc7586fc56b7c0d95590fbe4f.tar.bz2 |
Merge topic 'cmake-gui-qt6'
a6abe70e72 cmake-gui: Restore minimal plugin installation for Qt5
8dd88a5224 cmake-gui: Restore exclusion of static plugin installation
a65db7ef6a cmake-gui: Restore installation of Qt plugin dependencies
321cb5978f cmake-gui: Remove outdated FIXME comment about plugin installation
d391d05e3a cmake-gui: Fix CMake_QT_MAJOR_VERSION string comparison
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5675
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 1d3c66e..9ae677b 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMake_QT_MAJOR_VERSION "A" CACHE STRING "Expected Qt major version. Valid values are A (auto-select), 5, 6.") set(SUPPORTED_QT_VERSIONS "A" 5 6) set_property(CACHE CMake_QT_MAJOR_VERSION PROPERTY STRINGS ${SUPPORTED_QT_VERSIONS}) -if(NOT CMake_QT_MAJOR_VERSION VERSION_EQUAL "A") +if(NOT CMake_QT_MAJOR_VERSION STREQUAL "A") if(NOT CMake_QT_MAJOR_VERSION IN_LIST SUPPORTED_QT_VERSIONS) message(FATAL_ERROR "Supported Qt versions are \"${SUPPORTED_QT_VERSIONS}\"." " But CMake_QT_MAJOR_VERSION is set to ${CMake_QT_MAJOR_VERSION}.") @@ -63,8 +63,6 @@ if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) 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 unfortunately -# Qt5 support is missing there. if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) function(_qt_get_plugin_name_with_version target out_var) string(REGEX REPLACE "^Qt::(.+)" "Qt${INSTALLED_QT_VERSION}::\\1" @@ -114,18 +112,29 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) find_package(Qt${INSTALLED_QT_VERSION}${_qt_plugin} QUIET PATHS ${Qt${INSTALLED_QT_VERSION}${_qt_comp}_DIR}) endif() - install_qt_plugin(${_qt_plugin} _plugins_var) + install_qt_plugin("${_qt_plugin}" "${_plugins_var}") endforeach() endforeach() endmacro() - install_qt_plugins(QT_COMPONENTS QT_PLUGINS) if(APPLE) + if (INSTALLED_QT_VERSION VERSION_EQUAL 5) + install_qt_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + else() + # FIXME: Minimize plugins for Qt6. + install_qt_plugins(QT_COMPONENTS QT_PLUGINS) + endif() 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 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + if (INSTALLED_QT_VERSION VERSION_EQUAL 5) + install_qt_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) + else() + # FIXME: Minimize plugins for Qt6. + install_qt_plugins(QT_COMPONENTS QT_PLUGINS) + endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" |