summaryrefslogtreecommitdiffstats
path: root/cmake/qt.toolchain.cmake.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-09-15 13:00:22 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-09-15 20:05:28 +0200
commit93fc3afe71467ca6aeffa41d7a6f4a170f82b62e (patch)
tree2a0c584c91fffed046ce12232d4513c9ee427b1d /cmake/qt.toolchain.cmake.in
parent67567b8e0d15445aef7ce491930a6c1290122fac (diff)
CMake: Check that QT_HOST_PATH is set when using the Qt toolchain
If a consumer wants to cross-compile a Qt app, they need to provide the host Qt path location. When building Qt in the CI we embed the Qt host path into the generated CMake toolchain file for convenient building of other Qt modules. But once Qt is built, packaged and installed on a user's machine, most likely the Qt host path will not be the same. In such a case, if the user wants to use the convenience toolchain, they should explicitly provide the Qt host path via the QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR variables. Show an error message if the values are not provided or don't exist on the file system. It's possible that in the future the Qt installer will patch the toolchain file, or provide additional info, to point to the host Qt installation so that the user doesn't have to do it manually. But until that's done, a friendly error message is a good way to inform the user what they should do. Task-number: QTBUG-83999 Change-Id: I26291e3c47bb77375f8a5ce7b848c0382a660ca9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'cmake/qt.toolchain.cmake.in')
-rw-r--r--cmake/qt.toolchain.cmake.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in
index 8a2db98f28..c76c89c116 100644
--- a/cmake/qt.toolchain.cmake.in
+++ b/cmake/qt.toolchain.cmake.in
@@ -37,3 +37,4 @@ get_filename_component(QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR "${CMAKE_CURRENT_LIST_
# Qt install prefix, and the prefix path to the lib/cmake subdir.
list(PREPEND CMAKE_PREFIX_PATH "${QT_TOOLCHAIN_RELOCATABLE_CMAKE_DIR}")
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_TOOLCHAIN_RELOCATABLE_INSTALL_PREFIX}")
+@init_qt_host_path_checks@