From 5b76414b43ee0ffabf292b4c6535f15e42613f1b Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Thu, 13 Aug 2020 13:05:13 +0300 Subject: [PATCH] CMake: fix android target build not picking the correct sysroot This previous way caused target builds under Linux to pick the host packages like udev and mtdev and build for them which they will fail during the build. Task-number: QTBUG-86028 Change-Id: Ic029f0a3e71b50c694473a110922f0ef11e5b0bf Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a92f3dc036..fc08130795b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,14 @@ if(NOT QT_BUILD_STANDALONE_TESTS) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtAutoDetect.cmake) endif() +include(".cmake.conf") +project(QtBase + VERSION "${QT_REPO_MODULE_VERSION}" + DESCRIPTION "Qt Base Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C ASM +) + if (CMAKE_CROSSCOMPILING AND CMAKE_SYSROOT) # When cross compiling with CMake any calls to pkg_check_modules() will # search into the host system instead of the target sysroot. @@ -17,14 +25,6 @@ if (CMAKE_CROSSCOMPILING AND CMAKE_SYSROOT) set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) endif() -include(".cmake.conf") -project(QtBase - VERSION "${QT_REPO_MODULE_VERSION}" - DESCRIPTION "Qt Base Libraries" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX C ASM -) - if(NOT QT_BUILD_STANDALONE_TESTS) ## Add some paths to check for cmake modules: list(PREPEND CMAKE_MODULE_PATH