CMake: Rename QT_EXAMPLES_CMAKE_PREFIX_PATH

...to QT_BUILD_CMAKE_PREFIX_PATH, because the variable is now used for
examples and tests.

Change-Id: Ie6d32a0c99f46407f2771e12638456078c59fb18
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d5c4d6eb776b4b5e5299de519deb17af66048008)
This commit is contained in:
Joerg Bornemann 2023-08-23 10:11:15 +02:00 committed by Alexandru Croitor
parent 94f75e6067
commit f513c4cade
4 changed files with 8 additions and 8 deletions

View File

@ -735,9 +735,9 @@ endfunction()
macro(qt_build_tests)
set(CMAKE_UNITY_BUILD OFF)
# Prepending to QT_EXAMPLES_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# Prepending to QT_BUILD_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# find_package calls use NO_DEFAULT_PATH, and thus CMAKE_PREFIX_PATH is ignored.
list(PREPEND QT_EXAMPLES_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
list(PREPEND QT_BUILD_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
if(QT_BUILD_STANDALONE_TESTS)
# Find location of TestsConfig.cmake. These contain the modules that need to be
@ -981,14 +981,14 @@ macro(qt_examples_build_begin)
# Examples that are built as part of the Qt build need to use the CMake config files from the
# build dir, because they are not installed yet in a prefix build.
# Prepending to CMAKE_PREFIX_PATH helps find the initial Qt6Config.cmake.
# Prepending to QT_EXAMPLES_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# Prepending to QT_BUILD_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# find_package calls use NO_DEFAULT_PATH, and thus CMAKE_PREFIX_PATH is ignored.
# Prepending to CMAKE_FIND_ROOT_PATH ensures the components are found while cross-compiling
# without setting CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH.
if(NOT QT_IS_EXTERNAL_EXAMPLES_BUILD OR NOT __qt_all_examples_ported_to_external_projects)
qt_internal_set_up_build_dir_package_paths()
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_BUILD_DIR}")
list(PREPEND QT_EXAMPLES_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
list(PREPEND QT_BUILD_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
endif()
# Because CMAKE_INSTALL_RPATH is empty by default in the repo project, examples need to have
@ -1267,7 +1267,7 @@ function(qt_internal_add_example_external_project subdir)
CMAKE_BUILD_TYPE:STRING
CMAKE_CONFIGURATION_TYPES:STRING
CMAKE_PREFIX_PATH:STRING
QT_EXAMPLES_CMAKE_PREFIX_PATH:STRING
QT_BUILD_CMAKE_PREFIX_PATH:STRING
QT_ADDITIONAL_PACKAGES_PREFIX_PATH:STRING
CMAKE_FIND_ROOT_PATH:STRING
BUILD_SHARED_LIBS:BOOL

View File

@ -136,7 +136,7 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS})
PATHS
${_qt_cmake_dir}
${_qt_additional_packages_prefix_paths}
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
${QT_BUILD_CMAKE_PREFIX_PATH}
${__qt_find_package_host_qt_path}
${_qt_additional_host_packages_prefix_paths}
${__qt_use_no_default_path_for_qt_packages}

View File

@ -19,7 +19,7 @@ if(NOT @INSTALL_CMAKE_NAMESPACE@_FOUND)
"${CMAKE_CURRENT_LIST_DIR}/.."
"${_qt_cmake_dir}"
${_qt_additional_packages_prefix_paths}
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
${QT_BUILD_CMAKE_PREFIX_PATH}
${__qt_use_no_default_path_for_qt_packages}
)
endif()

View File

@ -114,7 +114,7 @@ macro(_qt_internal_find_qt_dependencies target target_dep_list find_dependency_p
PATHS
${${find_dependency_path_list}}
${_qt_additional_packages_prefix_paths}
${QT_EXAMPLES_CMAKE_PREFIX_PATH}
${QT_BUILD_CMAKE_PREFIX_PATH}
${__qt_use_no_default_path_for_qt_packages}
)
endif()