2018-10-24 13:20:27 +00:00
|
|
|
@PACKAGE_INIT@
|
|
|
|
|
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")
|
|
|
|
__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
|
|
|
|
2019-06-04 15:08:47 +00:00
|
|
|
if (NOT QT_NO_CREATE_TARGETS)
|
|
|
|
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)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessTargets.cmake")
|
|
|
|
endif()
|
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
|
|
|
|
2020-12-15 17:09:32 +00:00
|
|
|
if(NOT "${QT_HOST_PATH}" STREQUAL "")
|
|
|
|
find_package(Qt@PROJECT_VERSION_MAJOR@HostInfo
|
|
|
|
CONFIG
|
|
|
|
REQUIRED
|
|
|
|
PATHS "${QT_HOST_PATH}"
|
|
|
|
"${QT_HOST_PATH_CMAKE_DIR}"
|
|
|
|
NO_CMAKE_FIND_ROOT_PATH
|
|
|
|
NO_DEFAULT_PATH)
|
|
|
|
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")
|
|
|
|
|
2020-06-25 15:53:53 +00:00
|
|
|
if(APPLE AND (NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
|
|
|
# Add module directory to pick up custom Info.plist template for macOS
|
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
|
|
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/macos")
|
2021-04-14 16:16:44 +00:00
|
|
|
elseif(APPLE AND CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
|
|
|
# Add module directory to pick up custom Info.plist template for iOS
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${_qt_import_prefix}/ios")
|
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()
|
|
|
|
|
CMake: Fix QT_ADDITIONAL_PACKAGES_PREFIX_PATH for cross-builds
The QT_ADDITIONAL_PACKAGES_PREFIX_PATH variable was introduced to
allow specifying extra locations to find Qt packages.
The reason it was introduced instead of just using CMAKE_PREFIX_PATH
is because the Qt6 component find_package call uses NO_DEFAULT_PATH
which means CMAKE_PREFIX_PATH is ignored.
We use NO_DEFAULT_PATH to ensure we don't accidentally pick up
system / distro Qt packages.
The paths from QT_ADDITIONAL_PACKAGES_PREFIX_PATH are added to the
find_package PATHS option in the Qt6 package, each
ModuleDependencies.cmake file and some other places.
Unfortunately that's not enough to make it work for cross-builds.
Imagine the following scenario.
host qtbase, qtdeclarative installed in /host_qt
target qtbase installed in /target_qtbase
target qtdeclarative installed in /target_qtdeclarative
We want to cross-build qtlottie.
We configure qtlottie as follows
/target_qtbase/bin/qt-configure-module /qtlottie_src -- -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH=/target_qtdeclarative
We expect the target QtQuick package to be found, but it won't be.
The reason is that QT_ADDITIONAL_PACKAGES_PREFIX_PATH is added to the
PATHs option, but we don't adjust CMAKE_FIND_ROOT_PATH.
Without adding the new paths in CMAKE_FIND_ROOT_PATH, CMake will
re-root the passed PATHs under the existing CMAKE_FIND_ROOT_PATH,
which is QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX, which evaluates to
/target_qtbase. There is no QtQuick package there.
To fix this, prepend the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH
to CMAKE_FIND_ROOT_PATH.
The location where we currently do CMAKE_FIND_ROOT_PATH manipulations
is in the qt.toolchain.cmake file, so to be consistent, we prepend the
new prefixes there as well.
We need to adjust both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH,
due the path re-rooting bug in CMake.
See https://gitlab.kitware.com/cmake/cmake/-/issues/21937 as well as
the existing comment in qt.toolchain.cmake marked with
REROOT_PATH_ISSUE_MARKER.
We also need to do a few more things to make the setup work
Because Qt6Config uses NO_DEFAULT_PATH, the CMAKE_PREFIX_PATH
adjustments we do in the toolchain file are not enough, so we still need
to add the same prefixes to the Qt6Config find_package PATHS option.
One would ask why do we need to adjust CMAKE_PREFIX_PATH at all then.
It's for find_package(Qt6Foo) calls to work which don't go through
the Qt6Config umbrella package.
To make the CMake re-rooting behavior happy, we need to ensure the
provided paths are absolute.
So we iterate over the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH,
to make them absolute. We do the same for the environment variable.
We need to append lib/cmake to the prefixes which are added to
CMAKE_PREFIX_PATH, otherwise the CMake re-rooting bug is hit.
We need to specify the Qt6 package location (${_qt_cmake_dir}) to the
PATHS option in the various Dependencies.cmake.in files, to ensure
that dependency resolution can jump around between the Qt6 dir and
the additional prefixes. Previously the dependency lookup code assumed
that all dependencies would be within the same prefix.
The same is needed for qt and qml plugin dependency lookup.
Amends 7bb91398f25cb2016c0558fd397b376f413e3e96
Amends 60c87c68016c6f02b0eddd4002f75a49ab51d4a8
Amends 5bbd700124d13a292ff8bae6045316112500e230
Pick-to: 6.2
Fixes: QTBUG-95854
Change-Id: I35ae82330fec427d0d38fc9a0542ffafff52556a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-08-17 15:03:02 +00:00
|
|
|
set(QT_ADDITIONAL_PACKAGES_PREFIX_PATH "" CACHE STRING
|
|
|
|
"Additional directories where find(Qt6 ...) components are searched")
|
|
|
|
|
|
|
|
# Collect additional package prefix paths to look for Qt packages, both from command line and the
|
|
|
|
# env variable.
|
|
|
|
if(NOT DEFINED _qt_additional_packages_prefix_paths)
|
|
|
|
set(_qt_additional_packages_prefix_paths "")
|
|
|
|
|
|
|
|
set(_qt_additional_packages_prefixes "")
|
|
|
|
if(QT_ADDITIONAL_PACKAGES_PREFIX_PATH)
|
|
|
|
list(APPEND _qt_additional_packages_prefixes ${QT_ADDITIONAL_PACKAGES_PREFIX_PATH})
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH}
|
|
|
|
AND NOT "$ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH}" STREQUAL "")
|
|
|
|
list(APPEND _qt_additional_packages_prefixes $ENV{QT_ADDITIONAL_PACKAGES_PREFIX_PATH})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
foreach(_qt_additional_path IN LISTS _qt_additional_packages_prefixes)
|
|
|
|
file(TO_CMAKE_PATH "${_qt_additional_path}" _qt_additional_path)
|
|
|
|
|
|
|
|
# The prefix paths need to end with lib/cmake to ensure the packages are found when
|
|
|
|
# cross compiling. Search for REROOT_PATH_ISSUE_MARKER in the qt.toolchain.cmake file for
|
|
|
|
# details.
|
|
|
|
# We must pass the values via the PATHS options because the main find_package call uses
|
|
|
|
# NO_DEFAULT_PATH, and thus CMAKE_PREFIX_PATH values are discarded.
|
|
|
|
# CMAKE_FIND_ROOT_PATH values are not discarded and togegher with the PATHS option, it
|
|
|
|
# ensures packages from additional prefixes are found.
|
|
|
|
if(NOT _qt_additional_path MATCHES "/lib/cmake$")
|
|
|
|
string(APPEND _qt_additional_path "/lib/cmake")
|
|
|
|
endif()
|
|
|
|
list(APPEND _qt_additional_packages_prefix_paths "${_qt_additional_path}")
|
|
|
|
endforeach()
|
|
|
|
unset(_qt_additional_path)
|
|
|
|
unset(_qt_additional_packages_prefixes)
|
|
|
|
endif()
|
2021-02-24 15:07:37 +00:00
|
|
|
|
2021-04-28 13:25:18 +00:00
|
|
|
# Public helpers available to all Qt packages.
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtFeature.cmake")
|
2021-05-19 17:46:24 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicFinalizerHelpers.cmake")
|
2021-04-28 13:25:18 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicPluginHelpers.cmake")
|
2021-04-29 10:47:52 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicTargetHelpers.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicWalkLibsHelpers.cmake")
|
2021-06-14 14:24:57 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicFindPackageHelpers.cmake")
|
2021-06-17 14:18:59 +00:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/QtPublicDependencyHelpers.cmake")
|
2021-04-28 13:25:18 +00:00
|
|
|
|
2021-06-10 17:01:35 +00:00
|
|
|
if(NOT DEFINED QT_CMAKE_EXPORT_NAMESPACE)
|
|
|
|
set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@)
|
|
|
|
endif()
|
|
|
|
|
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)
|
|
|
|
|
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")
|
2020-09-14 07:06:58 +00:00
|
|
|
if(NOT @INSTALL_CMAKE_NAMESPACE@_DEPENDENCIES_FOUND)
|
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE)
|
|
|
|
message(FATAL_ERROR "Failed to find Qt Platform dependency: "
|
|
|
|
"${@INSTALL_CMAKE_NAMESPACE@_DEPENDENCY_NOT_FOUND_MESSAGE}")
|
|
|
|
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()
|
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS})
|
2021-08-04 15:36:22 +00:00
|
|
|
if(NOT "${QT_HOST_PATH}" STREQUAL ""
|
|
|
|
AND "${module}" MATCHES "Tools$"
|
|
|
|
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.
|
|
|
|
# TODO: Handle a hypothetical QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH
|
|
|
|
# See QTBUG-94524
|
|
|
|
set(__qt_find_package_host_qt_path "${QT_HOST_PATH}/lib/cmake")
|
|
|
|
set(__qt_backup_cmake_prefix_path "${CMAKE_PREFIX_PATH}")
|
|
|
|
set(__qt_backup_cmake_find_root_path "${CMAKE_FIND_ROOT_PATH}")
|
|
|
|
list(PREPEND CMAKE_PREFIX_PATH "${__qt_find_package_host_qt_path}")
|
|
|
|
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_HOST_PATH}")
|
|
|
|
endif()
|
|
|
|
|
2019-02-11 10:34:35 +00:00
|
|
|
find_package(@INSTALL_CMAKE_NAMESPACE@${module}
|
2021-08-18 16:41:18 +00:00
|
|
|
${@INSTALL_CMAKE_NAMESPACE@_FIND_VERSION}
|
2019-02-11 10:34:35 +00:00
|
|
|
${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET}
|
2020-09-25 18:02:56 +00:00
|
|
|
PATHS
|
|
|
|
${_qt_cmake_dir}
|
CMake: Fix QT_ADDITIONAL_PACKAGES_PREFIX_PATH for cross-builds
The QT_ADDITIONAL_PACKAGES_PREFIX_PATH variable was introduced to
allow specifying extra locations to find Qt packages.
The reason it was introduced instead of just using CMAKE_PREFIX_PATH
is because the Qt6 component find_package call uses NO_DEFAULT_PATH
which means CMAKE_PREFIX_PATH is ignored.
We use NO_DEFAULT_PATH to ensure we don't accidentally pick up
system / distro Qt packages.
The paths from QT_ADDITIONAL_PACKAGES_PREFIX_PATH are added to the
find_package PATHS option in the Qt6 package, each
ModuleDependencies.cmake file and some other places.
Unfortunately that's not enough to make it work for cross-builds.
Imagine the following scenario.
host qtbase, qtdeclarative installed in /host_qt
target qtbase installed in /target_qtbase
target qtdeclarative installed in /target_qtdeclarative
We want to cross-build qtlottie.
We configure qtlottie as follows
/target_qtbase/bin/qt-configure-module /qtlottie_src -- -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH=/target_qtdeclarative
We expect the target QtQuick package to be found, but it won't be.
The reason is that QT_ADDITIONAL_PACKAGES_PREFIX_PATH is added to the
PATHs option, but we don't adjust CMAKE_FIND_ROOT_PATH.
Without adding the new paths in CMAKE_FIND_ROOT_PATH, CMake will
re-root the passed PATHs under the existing CMAKE_FIND_ROOT_PATH,
which is QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX, which evaluates to
/target_qtbase. There is no QtQuick package there.
To fix this, prepend the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH
to CMAKE_FIND_ROOT_PATH.
The location where we currently do CMAKE_FIND_ROOT_PATH manipulations
is in the qt.toolchain.cmake file, so to be consistent, we prepend the
new prefixes there as well.
We need to adjust both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH,
due the path re-rooting bug in CMake.
See https://gitlab.kitware.com/cmake/cmake/-/issues/21937 as well as
the existing comment in qt.toolchain.cmake marked with
REROOT_PATH_ISSUE_MARKER.
We also need to do a few more things to make the setup work
Because Qt6Config uses NO_DEFAULT_PATH, the CMAKE_PREFIX_PATH
adjustments we do in the toolchain file are not enough, so we still need
to add the same prefixes to the Qt6Config find_package PATHS option.
One would ask why do we need to adjust CMAKE_PREFIX_PATH at all then.
It's for find_package(Qt6Foo) calls to work which don't go through
the Qt6Config umbrella package.
To make the CMake re-rooting behavior happy, we need to ensure the
provided paths are absolute.
So we iterate over the values of QT_ADDITIONAL_PACKAGES_PREFIX_PATH,
to make them absolute. We do the same for the environment variable.
We need to append lib/cmake to the prefixes which are added to
CMAKE_PREFIX_PATH, otherwise the CMake re-rooting bug is hit.
We need to specify the Qt6 package location (${_qt_cmake_dir}) to the
PATHS option in the various Dependencies.cmake.in files, to ensure
that dependency resolution can jump around between the Qt6 dir and
the additional prefixes. Previously the dependency lookup code assumed
that all dependencies would be within the same prefix.
The same is needed for qt and qml plugin dependency lookup.
Amends 7bb91398f25cb2016c0558fd397b376f413e3e96
Amends 60c87c68016c6f02b0eddd4002f75a49ab51d4a8
Amends 5bbd700124d13a292ff8bae6045316112500e230
Pick-to: 6.2
Fixes: QTBUG-95854
Change-Id: I35ae82330fec427d0d38fc9a0542ffafff52556a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-08-17 15:03:02 +00:00
|
|
|
${_qt_additional_packages_prefix_paths}
|
2020-09-25 18:02:56 +00:00
|
|
|
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
|
2021-08-04 15:36:22 +00:00
|
|
|
${__qt_find_package_host_qt_path}
|
2020-09-25 18:02:56 +00:00
|
|
|
${__qt_use_no_default_path_for_qt_packages}
|
2018-10-24 13:20:27 +00:00
|
|
|
)
|
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})
|
|
|
|
set(_Qt_NOTFOUND_MESSAGE
|
|
|
|
"${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\". ${_qt_component_not_found_msg}")
|
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
|
|
|
|
"Failed to find 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}")
|
|
|
|
set(@INSTALL_CMAKE_NAMESPACE@_FOUND False)
|
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
|
|
|
|
|
|
|
__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()
|