From d391d05e3a60baa1187071b1ce0246cab60d4e2e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Jan 2021 13:18:14 -0500 Subject: cmake-gui: Fix CMake_QT_MAJOR_VERSION string comparison Fix the string comparison added by commit 2e4cbaa521 (cmake-gui: Add a Qt version control variable, 2020-12-28). The version-based comparison is not meant for arbitrary strings. --- Source/QtDialog/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 1d3c66e..af4a798 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}.") -- cgit v0.12 From 321cb5978fe4d8ae298c4c03adc3a40b1979a078 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Jan 2021 10:19:44 -0500 Subject: cmake-gui: Remove outdated FIXME comment about plugin installation Qt plugin installation conventions are now well-established. --- Source/QtDialog/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index af4a798..6d0166e 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -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" -- cgit v0.12 From a65db7ef6ac0f8e4cacaa851a26cc3a0f4d5860b Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Jan 2021 13:00:53 -0500 Subject: cmake-gui: Restore installation of Qt plugin dependencies Fix logic from commit f1de6f6682 (cmake-gui: Support building against Qt6, 2020-12-17) to restore population of the `QT_PLUGINS` variable used in our `fixup_bundle` call. --- Source/QtDialog/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 6d0166e..a82884c 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -112,7 +112,7 @@ 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() -- cgit v0.12 From 8dd88a522489ac9b0ee749cc2bd98c5985315ac1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Jan 2021 13:04:20 -0500 Subject: cmake-gui: Restore exclusion of static plugin installation This was broken by commit f1de6f6682 (cmake-gui: Support building against Qt6, 2020-12-17). --- Source/QtDialog/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index a82884c..0ef725b 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -116,14 +116,15 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) endforeach() endforeach() endmacro() - install_qt_plugins(QT_COMPONENTS QT_PLUGINS) if(APPLE) + install_qt_plugins(QT_COMPONENTS 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 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + install_qt_plugins(QT_COMPONENTS QT_PLUGINS) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" -- cgit v0.12 From a6abe70e72141f03d284dfcc6559c2b4e2848b8e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 7 Jan 2021 13:14:16 -0500 Subject: cmake-gui: Restore minimal plugin installation for Qt5 Since commit f1de6f6682 (cmake-gui: Support building against Qt6, 2020-12-17) all available plugins for each Qt component are installed. This installs more than we need for CMake, so restore Qt5-specific logic to install only the plugins did before. --- Source/QtDialog/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 0ef725b..9ae677b 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -117,14 +117,24 @@ if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) endforeach() endmacro() if(APPLE) - install_qt_plugins(QT_COMPONENTS QT_PLUGINS) + 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) - install_qt_plugins(QT_COMPONENTS QT_PLUGINS) + 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" -- cgit v0.12