From cc3f693029d6fcc65a0153b658061bd121a6af66 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 11 Nov 2020 11:49:00 +0100 Subject: [PATCH] CMake: Do not set PKG_CONFIG_* environment variables This reverts commit 9968a211f92c2b4d5bd1fe004f16ec1c5f968dcd. The PKG_CONFIG_* environment variables should be added by the user environment, preferably by the toolchain file. Apparently, the change was added for Android before we turned off pkg-config for Android. It is not needed anymore. Change-Id: Ieeed09ae53a606c85d4937f463286b5b0f76bde9 Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 10 ---------- cmake/QtConfig.cmake.in | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cdfd96f5ef..f36c73b14e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,16 +27,6 @@ project(QtBase # Make sure we only use latest private CMake API, aka no compatibility wrappers. set(QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS TRUE) -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. - # The current work around is based on the discussion found at - # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4478 - set(ENV{PKG_CONFIG_DIR} "") - set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig") - set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) -endif() - if(NOT QT_BUILD_STANDALONE_TESTS) ## Add some paths to check for cmake modules: list(PREPEND CMAKE_MODULE_PATH diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index d6d6d179d23..8a8f73b1555 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -1,15 +1,5 @@ @PACKAGE_INIT@ -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. - # The current work around is based on the discussion found at - # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4478 - set(ENV{PKG_CONFIG_DIR} "") - set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig") - set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) -endif() - # Slightly amended version of ./src/corelib/Qt6Config.cmake.in if (CMAKE_VERSION VERSION_LESS 3.14) message(FATAL_ERROR "Qt requires at least CMake version 3.14")