aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-10-08 12:31:03 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-10-12 18:28:10 +0200
commit70dc8438fce5c9a5b6c9ea9392dbbadf92ea2cb1 (patch)
tree3656db833214837f85d3a70ff2f930a0191efa81 /CMakeLists.txt
parent643172a8dfeed5d849a6bf8c3090a70c3acb7579 (diff)
CMake: Fix find_package puzzle piece of top-level cross-builds
The subdirectories, the top-level CMakeLists.txt adds, contain find_package(Qt6 COMPONENTS ...) calls. When cross-compiling to Android, the toolchain file sets CMAKE_FIND_ROOT_PATH and CMAKE_FIND_ROOT_PATH_MODE to ONLY. That means, the packages that are created in qtbase can never be found by other Qt repositories, e.g. qtdeclarative. Append the qtbase build dir to CMAKE_FIND_ROOT_PATH to find the Qt packages of the build dir when cross-compiling. Because of some CMake idiosyncracy, we need to append "${QtBase_BINARY_DIR}/lib/cmake" to CMAKE_PREFIX_PATH and not just "${QtBase_BINARY_DIR}". See qtbase/ec90f9013b4c6b63d7e03a964f66f97329be7885 for details. Task-number: QTBUG-85080 Change-Id: I799f851316538c310d73f5ab59c809229e16e8a8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5feb49a9..13817e75 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,8 @@ list(REMOVE_ITEM git_module_list qtbase)
add_subdirectory(qtbase)
if (NOT QT_BUILD_STANDALONE_TESTS)
- list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}")
+ list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/lib/cmake")
+ list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
endif()
foreach(module IN LISTS git_module_list)