From 0f18aa010e768ffd20285f5acdb933b8a978c2d8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 31 Oct 2025 11:29:40 -0400 Subject: [PATCH] ci: Update to Qt 6.9.3 on macOS Get Qt updates fix `cmake-gui` button rendering when compiled with a macOS 26 SDK. Issue: #27325 --- .gitlab/.gitignore | 1 + .gitlab/ci/configure_macos_package.cmake | 1 + .../ci/configure_macos_package_common.cmake | 1 - .gitlab/ci/ctest_exclusions.cmake | 7 +++ .gitlab/ci/download_qt.cmake | 20 +++++--- .gitlab/ci/download_qt_hashes.cmake | 2 +- Help/release/dev/ci-macos-qt.rst | 6 +++ Source/QtDialog/CMakeLists.txt | 46 ++++++++++++------- 8 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 Help/release/dev/ci-macos-qt.rst diff --git a/.gitlab/.gitignore b/.gitlab/.gitignore index e8f9c980bd..f623bd78d0 100644 --- a/.gitlab/.gitignore +++ b/.gitlab/.gitignore @@ -1,5 +1,6 @@ # Ignore files known to be downloaded by CI jobs. /5.15.1-0-202009071110* +/6.9.3-0-202509261207* /appimagetool /bcc* /cmake* diff --git a/.gitlab/ci/configure_macos_package.cmake b/.gitlab/ci/configure_macos_package.cmake index cdc8fd23a3..9a86aebb19 100644 --- a/.gitlab/ci/configure_macos_package.cmake +++ b/.gitlab/ci/configure_macos_package.cmake @@ -1,5 +1,6 @@ set(CPACK_SYSTEM_NAME "macos-universal" CACHE STRING "") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "") +set(CMake_GUI_OSX_DEPLOYMENT_TARGET "12" CACHE STRING "") set(CMAKE_C_STANDARD "11" CACHE STRING "") set(CMAKE_CXX_STANDARD "17" CACHE STRING "") diff --git a/.gitlab/ci/configure_macos_package_common.cmake b/.gitlab/ci/configure_macos_package_common.cmake index 2ac7ad611e..05206bd424 100644 --- a/.gitlab/ci/configure_macos_package_common.cmake +++ b/.gitlab/ci/configure_macos_package_common.cmake @@ -11,7 +11,6 @@ set(BUILD_CursesDialog "ON" CACHE BOOL "") set(BUILD_QtDialog "TRUE" CACHE BOOL "") set(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL "3" CACHE STRING "") set(CMake_INSTALL_DEPENDENCIES "ON" CACHE BOOL "") -set(CMAKE_SKIP_RPATH "TRUE" CACHE BOOL "") set(CMake_TEST_BOOTSTRAP OFF CACHE BOOL "") set(CMake_TEST_NO_FindPackageModeMakefileTest "TRUE" CACHE BOOL "") diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake index 30f796b3e9..7cd048ffe1 100644 --- a/.gitlab/ci/ctest_exclusions.cmake +++ b/.gitlab/ci/ctest_exclusions.cmake @@ -41,6 +41,13 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "_valgrind") ) endif() +if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "_xcode") + list(APPEND test_exclusions + # FIXME(#27358): Qt6Autogen.RerunMocOnAddFile fails in Xcode. + "^Qt6Autogen.RerunMocOnAddFile$" + ) +endif() + string(REPLACE ";" "|" test_exclusions "${test_exclusions}") if (test_exclusions) set(test_exclusions "(${test_exclusions})") diff --git a/.gitlab/ci/download_qt.cmake b/.gitlab/ci/download_qt.cmake index d2560dd125..3715283faa 100644 --- a/.gitlab/ci/download_qt.cmake +++ b/.gitlab/ci/download_qt.cmake @@ -9,6 +9,8 @@ set(qt_version_patch "1") set(qt_version "${qt_version_major}.${qt_version_minor}.${qt_version_patch}") set(qt_version_nodot "${qt_version_major}${qt_version_minor}${qt_version_patch}") +set(qt_tar_workdir ".gitlab") + # Files needed to download. set(qt_files) if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows.*package") @@ -61,14 +63,19 @@ elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "windows") set(qt_url_path "${qt_platform}/desktop/qt5_${qt_version_nodot}/qt.qt5.${qt_version_nodot}.${qt_abi}") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos") if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos10.10_package") + set(qt_url_root "https://cmake.org/files/dependencies") + set(qt_url_path "") list(APPEND qt_files "qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz") set(qt_subdir "qt-5.9.9-macosx10.10-x86_64-arm64") else () - list(APPEND qt_files "qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz") - set(qt_subdir "qt-5.15.2-macosx10.13-x86_64-arm64") + # This URL is only visible inside of Kitware's network. + # Please use your own Qt Account to obtain these files. + set(qt_url_root "https://www.paraview.org/files/dependencies/internal/qt") + set(qt_url_path "mac_x64/desktop/qt6_693/qt6_693/qt.qt6.693.clang_64") + list(APPEND qt_files "6.9.3-0-202509261207qtbase-MacOS-MacOS_15-Clang-MacOS-MacOS_15-X86_64-ARM64.7z") + set(qt_subdir "qt-extract") + set(qt_tar_workdir ".gitlab/${qt_subdir}") endif() - set(qt_url_root "https://cmake.org/files/dependencies") - set(qt_url_path "") else() message(FATAL_ERROR "Unknown OS to use for Qt") endif () @@ -109,12 +116,13 @@ foreach (qt_file IN LISTS qt_files) endif () # Extract the file. + file(MAKE_DIRECTORY "${qt_tar_workdir}") execute_process( COMMAND "${CMAKE_COMMAND}" -E tar - xf "${qt_file}" - WORKING_DIRECTORY ".gitlab" + xf "${CMAKE_CURRENT_SOURCE_DIR}/.gitlab/${qt_file}" + WORKING_DIRECTORY "${qt_tar_workdir}" RESULT_VARIABLE res ERROR_VARIABLE err ERROR_STRIP_TRAILING_WHITESPACE) diff --git a/.gitlab/ci/download_qt_hashes.cmake b/.gitlab/ci/download_qt_hashes.cmake index 1b9cf1473c..e5448079ee 100644 --- a/.gitlab/ci/download_qt_hashes.cmake +++ b/.gitlab/ci/download_qt_hashes.cmake @@ -11,7 +11,7 @@ set("5.15.1-0-202009071110qtwinextras-Windows-Windows_10-MSVC2015-Windows-Window set("5.15.1-0-202009071110qtbase-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z_hash" df2813ce7c6cb4287abd7956cd1cb9d08312e4ac1208b6cb57af4df11b8ebba1) set("qt-5.9.9-macosx10.10-x86_64-arm64.tar.xz_hash" d4449771afa0bc6a809c14f1e6d939e7732494cf059503ae451e2bfe8fc60cc1) -set("qt-5.15.2-macosx10.13-x86_64-arm64.tar.xz_hash" 7b9463a01c8beeee5bf8d01c70deff2d08561cd20aaf6f7a2f41cf8b68ce8a6b) +set("6.9.3-0-202509261207qtbase-MacOS-MacOS_15-Clang-MacOS-MacOS_15-X86_64-ARM64.7z_hash" 805144e619b7c7b0e9c985d929e1f290241d88b884218db3ad7d56bd579d6b4a) set("qt-5.15.10-win-i386-msvc_v142-1.zip_hash" c158cebc054d3f4f09733772a8a04789e2884912d45782e8c0c5e6a0b2773e92) set("qt-5.15.10-win-x86_64-msvc_v142-1.zip_hash" d55c017aef359f6aa8c592b18ba13cc120c749417b55671548970690126cd139) diff --git a/Help/release/dev/ci-macos-qt.rst b/Help/release/dev/ci-macos-qt.rst new file mode 100644 index 0000000000..fde0b304c9 --- /dev/null +++ b/Help/release/dev/ci-macos-qt.rst @@ -0,0 +1,6 @@ +ci-macos-qt +----------- + +* The precompiled macOS binary provided on ``cmake.org`` for macOS 10.13+ + now requires macOS 12 or newer for the :manual:`cmake-gui(1)` application. + The command-line tools still run on macOS 10.13. diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index a882b64c58..b6eb31aea1 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -1,6 +1,10 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file LICENSE.rst or https://cmake.org/licensing for details. +if(CMake_GUI_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMake_GUI_OSX_DEPLOYMENT_TARGET}") +endif() + project(QtDialog) CMake_OPTIONAL_COMPONENT(cmake-gui) set(QT_COMPONENTS @@ -69,7 +73,7 @@ if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) endif() # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. -if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) +if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32) AND NOT COMMAND qt_generate_deploy_app_script) function(_qt_get_plugin_name_with_version target out_var) string(REGEX REPLACE "^Qt::(.+)" "Qt${CMake_QT_MAJOR_VERSION}::\\1" qt_plugin_with_version "${target}") @@ -332,23 +336,33 @@ if(APPLE) endif() if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) - # install rules for including 3rd party libs such as Qt - # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation - set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMake_INSTALL_BIN_DIR}/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") - if(APPLE) - set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMake_INSTALL_APP_DIR_SLASH}MacOS/CMake") - endif() - get_property(_Qt_Core_LOCATION TARGET Qt${CMake_QT_MAJOR_VERSION}::Core PROPERTY LOCATION) - if(APPLE AND _Qt_Core_LOCATION MATCHES [[^(.*)/[^/]*\.framework/]]) - set(Qt_LIB_DIR "${CMAKE_MATCH_1}") + if(COMMAND qt_generate_deploy_app_script) + # Qt libraries are found via @rpath, so point the runtime path at them. + set_property(TARGET cmake-gui PROPERTY INSTALL_RPATH "@executable_path/../Frameworks") + qt_generate_deploy_app_script( + TARGET cmake-gui + OUTPUT_SCRIPT qt_deploy_script + ) + install(SCRIPT "${qt_deploy_script}") else() - get_filename_component(Qt_LIB_DIR "${_Qt_Core_LOCATION}" PATH) + # install rules for including 3rd party libs such as Qt + # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMake_INSTALL_BIN_DIR}/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") + if(APPLE) + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMake_INSTALL_APP_DIR_SLASH}MacOS/CMake") + endif() + get_property(_Qt_Core_LOCATION TARGET Qt${CMake_QT_MAJOR_VERSION}::Core PROPERTY LOCATION) + if(APPLE AND _Qt_Core_LOCATION MATCHES [[^(.*)/[^/]*\.framework/]]) + set(Qt_LIB_DIR "${CMAKE_MATCH_1}") + else() + get_filename_component(Qt_LIB_DIR "${_Qt_Core_LOCATION}" PATH) + endif() + install(CODE " + include(BundleUtilities) + set(BU_CHMOD_BUNDLE_ITEMS ON) + fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${Qt_LIB_DIR};${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") + " ${COMPONENT}) endif() - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS ON) - fixup_bundle(\"${fixup_exe}\" \"${QT_PLUGINS}\" \"${Qt_LIB_DIR};${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") - " ${COMPONENT}) endif() set(CMAKE_PACKAGE_QTGUI TRUE)