From 37e7f8246cb7c50167782f9f3c695bd3786a1e36 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Wed, 13 Dec 2023 18:17:26 +0100 Subject: [PATCH] Fix an issue where it was not possible to build iOS tests in tree Before this, when trying to build iOS tests, CMake could not find the `LaunchScreen.storyboard` in the source directory, and therefore the configuration was failing. In addition, QtPublicFinalizerHelpers module was missing in QtBuild, resulting in another configuration failure when configuring iOS tests. Change-Id: I592121892a2716973a92ec044414fa729fd3b15f Reviewed-by: Alexandru Croitor (cherry picked from commit 0c3892bb261f0eebebdff4cf42169f49729956a9) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtBuildPathsHelpers.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/QtBuildPathsHelpers.cmake b/cmake/QtBuildPathsHelpers.cmake index edc43f2f140..18082ac6a5f 100644 --- a/cmake/QtBuildPathsHelpers.cmake +++ b/cmake/QtBuildPathsHelpers.cmake @@ -205,6 +205,18 @@ macro(qt_internal_set_qt_cmake_dir) set(QT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") endmacro() +macro(qt_internal_set_qt_apple_support_files_path) + # This is analogous to what we have in QtConfig.cmake.in. It's copied here so that iOS + # tests can be built in tree. + if(APPLE) + if(NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(__qt_internal_cmake_apple_support_files_path "${QT_CMAKE_DIR}/macos") + elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS") + set(__qt_internal_cmake_apple_support_files_path "${QT_CMAKE_DIR}/ios") + endif() + endif() +endmacro() + macro(qt_internal_set_qt_staging_prefix) if(NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "") set(QT_STAGING_PREFIX "${CMAKE_STAGING_PREFIX}") @@ -227,4 +239,6 @@ macro(qt_internal_setup_paths_and_prefixes) qt_internal_set_cmake_install_libdir() qt_internal_set_qt_cmake_dir() + + qt_internal_set_qt_apple_support_files_path() endmacro()