2024-02-20 08:45:50 +00:00
|
|
|
# Copyright (C) 2024 The Qt Company Ltd.
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2018-10-24 13:20:27 +00:00
|
|
|
@PACKAGE_INIT@
|
|
|
|
|
CMake: Adjust CMP0156 policy handling for Apple platforms
Backstory.
1) Starting with Qt 6.8, the prebuilt Qt for iOS SDK is built as
static framework bundles instead of static libraries. That is done so
that we can embed a privacy manifest into each framework bundle.
2) Up until CMake 3.28, CMake would not attempt to de-duplicate static
libraries (or frameworks) on the command line. Starting with CMake
3.29, the CMP0156 policy was introduced to allow such de-duplication.
3) Since a while ago, Qt had its own policy handling for CMP0156,
which it force sets to OLD, to disable any de-duplication. That was
done to avoid possible regressions on platforms where link order
matters.
4) A developer might add the -ObjC linker flag to a project, to ensure
the linker retains all Objective-C categories it encounters in all the
static libraries that were provided on the link line. Retaining in
this case means that the /whole/ object file of a static library will
be linked to the final executable.
5) The Apple ld linker (both the legacy and the new ld_prime one)
can't cope with duplicate static frameworks on the link line when the
-ObjC flag is used.
It ends up throwing duplicate symbol errors, from trying to link the
same object file from the same static framework more than once.
The linker works just fine if the link line contains duplicate static
libraries, rather than static frameworks.
6) When a project links against Qt6::Gui and Qt6::Core, the link line
will contain Qt6::Core twice. This gets even more involved, when
linking plugins, which cause static framework cycles, and thus a
framework might appear multiple times.
Thus, we have the situation that Qt forces the CMP0156 policy to OLD,
Qt6::Core appears multiple times on the link line, no de-duplication
is performed, the project adds the -ObjC flag, and the linker throws
duplicate symbol errors.
We can fix this by force setting the CMP0156 policy to NEW when
targeting Apple platforms and using CMake 3.29+.
A potential workaround for a project developer is to set the policy
to NEW manually in their project.
Unfortunately that doesn't work for older Qt versions.
That's because CMake applies the policy value when add_executable is
called, and the policy value in qt_add_executable is the one that is
recorded when the function is defined. And the recorded policy is
always OLD, because Qt6Config.cmake calls cmake_minimum_required with
VERSION up to 3.21, which resets the policy value to OLD.
So we have to force set the policy in qt_add_executable /
qt_add_library via the existing __qt_internal_set_cmp0156 function.
The __qt_internal_set_cmp0156 had some diagnostics to show a warning
when the user modifies the policy themselves, but this never worked
because of reason stated above: the policy value was always overridden
in Qt6Config.cmake.
To actually make the diagnostic work, there is now new code to save
the policy value in the current directory scope, before Qt resets
it.
This only works if a project uses the find_package(Qt6 COMPONENTS Foo)
signature. It won't work with a find_package(Qt6Core)-like signature.
The policy value is not modified for platforms other than Apple ones
for now.
Amends 9702c3c78b2c16db6a9d0515d7d7698d9b064cd8
Pick-to: 6.5 6.8 6.9
Fixes: QTBUG-135978
Change-Id: I4d6e6c2a01e7092b417fc669d2aea40cf2dca578
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-05-05 15:18:49 +00:00
|
|
|
# This is included before the cmake_minimum_required on purpose.
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicCMakeEarlyPolicyHelpers.cmake")
|
|
|
|
__qt_internal_save_directory_scope_policy_cmp0156()
|
|
|
|
|
2020-11-30 07:46:49 +00:00
|
|
|
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2021-07-22 14:23:51 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@ConfigExtras.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicCMakeVersionHelpers.cmake")
|
2024-01-24 15:12:19 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicCMakeHelpers.cmake")
|
2024-03-20 11:43:37 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtInstallPaths.cmake")
|
|
|
|
|
2021-07-22 14:23:51 +00:00
|
|
|
__qt_internal_require_suitable_cmake_version_for_using_qt()
|
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
2019-09-19 11:46:37 +00:00
|
|
|
set(_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2025-03-05 10:27:25 +00:00
|
|
|
# Do the checks inside Targets.cmake even when the file is still being generated
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@TargetsPrecheck.cmake")
|
|
|
|
|
|
|
|
# Create the targets unless we are generating the @INSTALL_CMAKE_NAMESPACE@Targets.cmake
|
|
|
|
if(NOT __qt_skip_include_targets_file)
|
2019-06-04 15:08:47 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake")
|
2019-12-05 12:54:07 +00:00
|
|
|
if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS)
|
2024-01-24 15:12:19 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.18 OR QT_USE_OLD_VERSION_LESS_TARGETS)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessTargets.cmake")
|
|
|
|
else()
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessAliasTargets.cmake")
|
|
|
|
endif()
|
2019-12-05 12:54:07 +00:00
|
|
|
endif()
|
2025-03-05 10:27:25 +00:00
|
|
|
set(__qt_targets_file_included ON)
|
2019-06-04 15:08:47 +00:00
|
|
|
else()
|
|
|
|
# For examples using `find_package(...)` inside their CMakeLists.txt files:
|
|
|
|
# Make CMake's AUTOGEN detect this Qt version properly
|
|
|
|
set_directory_properties(PROPERTIES
|
|
|
|
QT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
|
2019-12-11 15:14:22 +00:00
|
|
|
QT_VERSION_MINOR @PROJECT_VERSION_MINOR@
|
|
|
|
QT_VERSION_PATCH @PROJECT_VERSION_PATCH@)
|
2019-06-04 15:08:47 +00:00
|
|
|
endif()
|
2019-05-03 10:30:09 +00:00
|
|
|
|
2024-09-24 13:20:00 +00:00
|
|
|
if(TARGET @INSTALL_CMAKE_NAMESPACE@::PlatformCommonInternal)
|
|
|
|
get_target_property(_qt_platform_internal_common_target
|
|
|
|
@INSTALL_CMAKE_NAMESPACE@::PlatformCommonInternal ALIASED_TARGET)
|
|
|
|
if(NOT _qt_platform_internal_common_target)
|
|
|
|
set(_qt_platform_internal_common_target @INSTALL_CMAKE_NAMESPACE@::PlatformCommonInternal)
|
|
|
|
endif()
|
2025-01-24 16:27:25 +00:00
|
|
|
set(_qt_internal_clang_msvc_frontend FALSE)
|
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
|
|
|
|
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
|
|
|
set(_qt_internal_clang_msvc_frontend TRUE)
|
|
|
|
endif()
|
2024-09-24 13:20:00 +00:00
|
|
|
set_target_properties(${_qt_platform_internal_common_target}
|
|
|
|
PROPERTIES
|
|
|
|
_qt_internal_cmake_generator "${CMAKE_GENERATOR}"
|
2025-01-24 16:27:25 +00:00
|
|
|
_qt_internal_clang_msvc_frontend "${_qt_internal_clang_msvc_frontend}"
|
2024-09-24 13:20:00 +00:00
|
|
|
)
|
|
|
|
unset(_qt_platform_internal_common_target)
|
|
|
|
endif()
|
|
|
|
|
2019-09-30 11:22:15 +00:00
|
|
|
get_filename_component(_qt_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
|
|
get_filename_component(_qt_import_prefix "${_qt_import_prefix}" REALPATH)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/3rdparty/extra-cmake-modules/find-modules")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/3rdparty/kwin")
|
|
|
|
|
2023-04-20 10:13:09 +00:00
|
|
|
if(APPLE)
|
|
|
|
if(NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
set(__qt_internal_cmake_apple_support_files_path "${_qt_import_prefix}/macos")
|
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
|
|
|
set(__qt_internal_cmake_apple_support_files_path "${_qt_import_prefix}/ios")
|
2024-03-18 18:35:52 +00:00
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "visionOS")
|
|
|
|
set(__qt_internal_cmake_apple_support_files_path "${_qt_import_prefix}/visionos")
|
2023-04-20 10:13:09 +00:00
|
|
|
endif()
|
cmake: Add default Info.plist for macOS with some important keys
The default Info.plist shipped with CMake lacks an NSPrincipalClass
entry, which is crucial for making macOS apps run in full resolution
on retina screens.
We make sure the file is only picked up on macOS, not iOS and friends,
since those platforms require another principal class. If needed we can
extract the value out as a CMake variable and use the same file for all
Apple platforms. Doing so would assume all keys are single-platform
only, so if that's not the case we need platform-specific files.
We should probably extract the package type out as a variable too,
so that the file can be used for both apps, plugins, and frameworks,
but doing so requires setting up that variable somewhere based on
the target type, which CMake doesn't allow in an easy way.
The file itself is based on the file CMake ships, combined with
keys inherited from Qt's existing plist templates for qmake, and
adjusted to match what Xcode generates by default these days.
Change-Id: I3f5109e5fff63cdbd109a99d4008948d4bd2102b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-11 20:45:50 +00:00
|
|
|
endif()
|
|
|
|
|
2021-04-28 13:25:18 +00:00
|
|
|
# Public helpers available to all Qt packages.
|
2023-11-17 16:47:04 +00:00
|
|
|
set(__qt_public_files_to_include
|
|
|
|
@QT_PUBLIC_FILES_TO_INCLUDE@
|
|
|
|
)
|
|
|
|
foreach(__qt_public_file_to_include IN LISTS __qt_public_files_to_include)
|
|
|
|
include("${__qt_public_file_to_include}")
|
|
|
|
endforeach()
|
2021-04-28 13:25:18 +00:00
|
|
|
|
2024-03-20 08:45:48 +00:00
|
|
|
if(NOT DEFINED QT_CMAKE_EXPORT_NAMESPACE)
|
|
|
|
set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@)
|
|
|
|
endif()
|
|
|
|
|
2022-09-13 15:27:42 +00:00
|
|
|
set(QT_ADDITIONAL_PACKAGES_PREFIX_PATH "" CACHE STRING
|
|
|
|
"Additional directories where find(Qt6 ...) components are searched")
|
|
|
|
set(QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH "" CACHE STRING
|
|
|
|
"Additional directories where find(Qt6 ...) host Qt components are searched")
|
|
|
|
|
|
|
|
__qt_internal_collect_additional_prefix_paths(_qt_additional_packages_prefix_paths
|
|
|
|
QT_ADDITIONAL_PACKAGES_PREFIX_PATH)
|
|
|
|
__qt_internal_collect_additional_prefix_paths(_qt_additional_host_packages_prefix_paths
|
|
|
|
QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH)
|
|
|
|
|
2022-09-13 15:23:55 +00:00
|
|
|
__qt_internal_prefix_paths_to_roots(_qt_additional_host_packages_root_paths
|
|
|
|
"${_qt_additional_host_packages_prefix_paths}")
|
|
|
|
|
2024-02-29 07:10:31 +00:00
|
|
|
__qt_internal_collect_additional_module_paths()
|
|
|
|
|
2021-06-24 10:30:32 +00:00
|
|
|
# Propagate sanitizer flags to both internal Qt builds and user projects.
|
|
|
|
# Allow opt-out in case if downstream projects handle it in a different way.
|
|
|
|
set(QT_CONFIGURED_SANITIZER_OPTIONS "@ECM_ENABLE_SANITIZERS@")
|
|
|
|
|
|
|
|
if(QT_CONFIGURED_SANITIZER_OPTIONS
|
|
|
|
AND NOT __qt_sanitizer_options_set
|
|
|
|
AND NOT QT_NO_ADD_SANITIZER_OPTIONS)
|
|
|
|
set(ECM_ENABLE_SANITIZERS "${QT_CONFIGURED_SANITIZER_OPTIONS}")
|
|
|
|
include(
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake")
|
|
|
|
endif()
|
|
|
|
# Mark that the current directory scope has its sanitizer flags set.
|
|
|
|
set(__qt_sanitizer_options_set TRUE)
|
|
|
|
|
CMake: Workaround Android CMP0155 issue
If a user:
- targets Android
- sets cmake_minimum_required(3.29) in their project which implies
policy CMP0155 being set to NEW
- sets CMAKE_CXX_STANDARD >= 20
- uses Qt Creator's maintenance tool provider
- uses Qt Creator's default of ANDROID_USE_LEGACY_TOOLCHAIN_FILE=OFF
then they will hit an issue where the Threads package cannot be found
due to a CMake bug that causes all try_compile calls to fail, which
in turns causes the Qt6 package not being found.
Android and ANDROID_USE_LEGACY_TOOLCHAIN_FILE being OFF is relevant,
because in that case CMake fails to find the
CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS tool, which is used during
try_compile builds.
CMP0155 set to NEW and CMAKE_CXX_STANDARD >= 20 is relevant,
because only in that case will CMake try to use the scan deps tool to
scan for modules during try_compile builds.
The maintenance tool provider is relevant in this case, because CMake
records the CMP0155 policy value at function definition time.
Normally without a dependency provider, the policy value at Threads
package lookup time would be OLD because each Qt6Config.cmake file
has a cmake_minimum_required(3.16..3.21) call which overrides any
other policy value.
But because the dependency provider function is defined before any of
Qt's code is loaded, it inherits the CMP0155 NEW from
cmake_minimum_required(3.29) of the user's project. That causes
all find_package lookups to use CMP0155=NEW, ignoring Qt's request.
This works by design from CMake's PoV, but causes unfortunate fallout
in this case.
Because we can't influence the recorded policy value of the provided
function from the outside in any way, the only thing we can do is
disable module scanning via CMAKE_CXX_SCAN_FOR_MODULES.
Work around the issue by setting CMAKE_CXX_SCAN_FOR_MODULES to OFF
inside Qt6Config.cmake, which will set it in the directory scope of
the find_package(Qt6) caller, affecting all try_compile calls there.
Do it only in the specific conditions mentioned above.
Allow opting out of the variable assignment by configuring with
-DQT_NO_SET_CMAKE_CXX_SCAN_FOR_MODULES_TO_OFF=ON
Doing this in Qt6Config.cmake allows working around the issue when
using older Creator versions that don't work around it themselves,
See https://gitlab.kitware.com/cmake/cmake/-/issues/27169
Pick-to: 6.8 6.9 6.10
Fixes: QTBUG-139439
Change-Id: Id171c88566c41b65b24c2f2a3874e3f3c0abc814
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-08-28 14:48:37 +00:00
|
|
|
@QT_CONFIG_EXTRA_CODE_BEFORE_DEPENDENCIES@
|
|
|
|
|
2020-08-03 14:28:16 +00:00
|
|
|
# Find required dependencies, if any.
|
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Dependencies.cmake")
|
2022-07-14 13:28:12 +00:00
|
|
|
|
2022-07-14 15:00:56 +00:00
|
|
|
_qt_internal_suggest_dependency_debugging(@INSTALL_CMAKE_NAMESPACE@
|
2022-07-14 13:28:12 +00:00
|
|
|
__qt_@INSTALL_CMAKE_NAMESPACE@_pkg ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE)
|
|
|
|
|
2022-07-13 15:44:55 +00:00
|
|
|
if(NOT @INSTALL_CMAKE_NAMESPACE@_FOUND)
|
|
|
|
# Clear the components, no need to look for them if dependencies were not found, otherwise
|
|
|
|
# you get a wall of recursive error messages.
|
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS "")
|
2020-09-14 07:06:58 +00:00
|
|
|
endif()
|
2020-08-03 14:28:16 +00:00
|
|
|
endif()
|
|
|
|
|
2021-08-04 10:23:14 +00:00
|
|
|
set(_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET)
|
|
|
|
if(@INSTALL_CMAKE_NAMESPACE@_FIND_QUIETLY)
|
|
|
|
set(_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET QUIET)
|
|
|
|
endif()
|
|
|
|
|
2020-09-25 18:02:56 +00:00
|
|
|
set(__qt_use_no_default_path_for_qt_packages "NO_DEFAULT_PATH")
|
|
|
|
if(QT_DISABLE_NO_DEFAULT_PATH_IN_QT_PACKAGES)
|
|
|
|
set(__qt_use_no_default_path_for_qt_packages "")
|
|
|
|
endif()
|
|
|
|
|
2025-01-23 18:29:17 +00:00
|
|
|
set(__qt_umbrella_find_components ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS})
|
|
|
|
__qt_internal_handle_find_all_qt_module_packages(__qt_umbrella_find_components
|
|
|
|
COMPONENTS ${__qt_umbrella_find_components}
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach(module ${__qt_umbrella_find_components})
|
2021-08-04 15:36:22 +00:00
|
|
|
if(NOT "${QT_HOST_PATH}" STREQUAL ""
|
|
|
|
AND "${module}" MATCHES "Tools$"
|
2022-01-26 13:33:31 +00:00
|
|
|
AND NOT "${module}" MATCHES "UiTools$"
|
2021-08-04 15:36:22 +00:00
|
|
|
AND NOT "${module}" MATCHES "ShaderTools$"
|
|
|
|
AND NOT "${module}" MATCHES "^Tools$"
|
|
|
|
AND NOT QT_NO_FIND_HOST_TOOLS_PATH_MANIPULATION)
|
|
|
|
# Make sure that a Qt*Tools package is also looked up in QT_HOST_PATH.
|
|
|
|
# But don't match QtShaderTools and QtTools which are cross-compiled target package names.
|
|
|
|
# Allow opt out just in case.
|
2021-10-20 15:52:00 +00:00
|
|
|
get_filename_component(__qt_find_package_host_qt_path
|
2025-03-17 16:54:32 +00:00
|
|
|
"${@INSTALL_CMAKE_NAMESPACE@HostInfo_DIR}/.." ABSOLUTE)
|
2021-08-04 15:36:22 +00:00
|
|
|
set(__qt_backup_cmake_prefix_path "${CMAKE_PREFIX_PATH}")
|
|
|
|
set(__qt_backup_cmake_find_root_path "${CMAKE_FIND_ROOT_PATH}")
|
2022-01-11 16:44:10 +00:00
|
|
|
list(PREPEND CMAKE_PREFIX_PATH "${__qt_find_package_host_qt_path}"
|
|
|
|
${_qt_additional_host_packages_prefix_paths})
|
|
|
|
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_HOST_PATH}"
|
|
|
|
${_qt_additional_host_packages_root_paths})
|
2021-08-04 15:36:22 +00:00
|
|
|
endif()
|
|
|
|
|
2022-07-14 15:00:56 +00:00
|
|
|
_qt_internal_save_find_package_context_for_debugging(@INSTALL_CMAKE_NAMESPACE@${module})
|
|
|
|
|
2025-01-29 07:50:17 +00:00
|
|
|
if(@INSTALL_CMAKE_NAMESPACE@${module}_FOUND)
|
2025-02-17 09:17:43 +00:00
|
|
|
# Tools packages don't usually provide a qt module, so there's no target.
|
|
|
|
if(TARGET @INSTALL_CMAKE_NAMESPACE@::${module})
|
|
|
|
get_target_property(__qt_${module}_is_private @INSTALL_CMAKE_NAMESPACE@::${module}
|
|
|
|
_qt_is_private_module
|
|
|
|
)
|
|
|
|
if(__qt_${module}_is_private)
|
|
|
|
_qt_internal_show_private_module_warning(${module})
|
|
|
|
endif()
|
|
|
|
unset(__qt_${module}_is_private)
|
2025-01-29 07:50:17 +00:00
|
|
|
endif()
|
|
|
|
else()
|
2022-07-19 16:37:04 +00:00
|
|
|
find_package(@INSTALL_CMAKE_NAMESPACE@${module}
|
|
|
|
${@INSTALL_CMAKE_NAMESPACE@_FIND_VERSION}
|
|
|
|
${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET}
|
|
|
|
PATHS
|
2023-08-22 17:11:30 +00:00
|
|
|
${QT_BUILD_CMAKE_PREFIX_PATH}
|
2022-07-19 16:37:04 +00:00
|
|
|
${_qt_cmake_dir}
|
|
|
|
${_qt_additional_packages_prefix_paths}
|
|
|
|
${__qt_find_package_host_qt_path}
|
|
|
|
${_qt_additional_host_packages_prefix_paths}
|
|
|
|
${__qt_use_no_default_path_for_qt_packages}
|
|
|
|
)
|
|
|
|
endif()
|
2021-08-04 15:36:22 +00:00
|
|
|
|
|
|
|
if(NOT "${__qt_find_package_host_qt_path}" STREQUAL "")
|
|
|
|
set(CMAKE_PREFIX_PATH "${__qt_backup_cmake_prefix_path}")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH "${__qt_backup_cmake_find_root_path}")
|
|
|
|
unset(__qt_backup_cmake_prefix_path)
|
|
|
|
unset(__qt_backup_cmake_find_root_path)
|
|
|
|
unset(__qt_find_package_host_qt_path)
|
|
|
|
endif()
|
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
if (NOT @INSTALL_CMAKE_NAMESPACE@${module}_FOUND)
|
2021-08-02 14:02:04 +00:00
|
|
|
set(_qt_expected_component_config_path
|
|
|
|
"${_qt_cmake_dir}/@INSTALL_CMAKE_NAMESPACE@${module}/@INSTALL_CMAKE_NAMESPACE@${module}Config.cmake")
|
|
|
|
get_filename_component(
|
|
|
|
_qt_expected_component_dir_path "${_qt_expected_component_config_path}" DIRECTORY)
|
|
|
|
|
|
|
|
set(_qt_component_not_found_msg
|
|
|
|
"\nExpected Config file at \"${_qt_expected_component_config_path}\"")
|
|
|
|
|
|
|
|
if(EXISTS "${_qt_expected_component_config_path}")
|
|
|
|
string(APPEND _qt_component_not_found_msg " exists \n")
|
|
|
|
else()
|
|
|
|
string(APPEND _qt_component_not_found_msg " does NOT exist\n")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(_qt_candidate_component_dir_path "${@INSTALL_CMAKE_NAMESPACE@${module}_DIR}")
|
|
|
|
|
|
|
|
if(_qt_candidate_component_dir_path AND
|
|
|
|
NOT _qt_expected_component_dir_path STREQUAL _qt_candidate_component_dir_path)
|
|
|
|
string(APPEND _qt_component_not_found_msg
|
|
|
|
"\n@INSTALL_CMAKE_NAMESPACE@${module}_DIR was computed by CMake or specified on the "
|
|
|
|
"command line by the user: \"${_qt_candidate_component_dir_path}\" "
|
|
|
|
"\nThe expected and computed paths are different, which might be the reason for "
|
|
|
|
"the package not to be found.")
|
|
|
|
endif()
|
2018-10-24 13:20:27 +00:00
|
|
|
|
2021-08-02 14:02:04 +00:00
|
|
|
if(@INSTALL_CMAKE_NAMESPACE@_FIND_REQUIRED_${module})
|
2022-07-14 13:28:12 +00:00
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@_FOUND False)
|
2021-08-02 14:02:04 +00:00
|
|
|
set(_Qt_NOTFOUND_MESSAGE
|
2022-07-13 17:24:52 +00:00
|
|
|
"${_Qt_NOTFOUND_MESSAGE}Failed to find required Qt component \"${module}\". ${_qt_component_not_found_msg}")
|
2022-07-14 13:28:12 +00:00
|
|
|
set(_qt_full_component_name "@INSTALL_CMAKE_NAMESPACE@${module}")
|
2022-07-14 15:00:56 +00:00
|
|
|
_qt_internal_suggest_dependency_debugging(${_qt_full_component_name}
|
|
|
|
_qt_full_component_name _Qt_NOTFOUND_MESSAGE)
|
2022-07-14 13:28:12 +00:00
|
|
|
unset(_qt_full_component_name)
|
2022-07-13 16:11:54 +00:00
|
|
|
break()
|
2019-06-03 18:47:37 +00:00
|
|
|
elseif(NOT @INSTALL_CMAKE_NAMESPACE@_FIND_QUIETLY)
|
2021-08-02 14:02:04 +00:00
|
|
|
message(WARNING
|
2022-07-13 17:24:52 +00:00
|
|
|
"Failed to find optional Qt component \"${module}\". ${_qt_component_not_found_msg}")
|
2018-10-24 13:20:27 +00:00
|
|
|
endif()
|
|
|
|
|
2021-08-02 14:02:04 +00:00
|
|
|
unset(_qt_expected_component_config_path)
|
|
|
|
unset(_qt_expected_component_dir_path)
|
|
|
|
unset(_qt_candidate_component_dir_path)
|
|
|
|
unset(_qt_component_not_found_msg)
|
2018-10-24 13:20:27 +00:00
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2021-08-02 14:02:04 +00:00
|
|
|
if(@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS AND _Qt_NOTFOUND_MESSAGE)
|
2019-02-11 10:34:35 +00:00
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}")
|
2021-08-02 14:02:04 +00:00
|
|
|
unset(_Qt_NOTFOUND_MESSAGE)
|
2018-10-24 13:20:27 +00:00
|
|
|
endif()
|
2021-06-11 07:54:47 +00:00
|
|
|
|
2022-07-26 13:51:02 +00:00
|
|
|
if(@INSTALL_CMAKE_NAMESPACE@_FOUND
|
|
|
|
AND COMMAND _qt_internal_override_example_install_dir_to_dot
|
|
|
|
AND NOT _qt_internal_example_dir_set_to_dot)
|
|
|
|
_qt_internal_override_example_install_dir_to_dot()
|
|
|
|
endif()
|
|
|
|
|
2021-06-11 07:54:47 +00:00
|
|
|
__qt_internal_defer_promote_targets_in_dir_scope_to_global()
|
2021-06-29 16:00:39 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.21)
|
|
|
|
__qt_internal_check_link_order_matters()
|
|
|
|
__qt_internal_check_cmp0099_available()
|
|
|
|
endif()
|