From 165e01d5d51d16377542c1b3ffbc22f03fb75e97 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 30 Sep 2021 15:05:52 +0200 Subject: CMake: Ensure that UNIX is set for INTEGRITY Certain platform-related variables, in this case UNIX, must be set in a platform module, because they get cleared after the toolchain file is loaded. Such platform modules live in upstream CMake, but there is none yet for INTEGRITY. This manifests in an undefined UNIX variable and "System is unknown to CMake" warnings for the project and every configure test. Add the CMake module "Platform/Integrity" in the cmake/platforms directory. Add this directory to CMAKE_MODULE_PATH to let CMake load Platform/Integrity when the toolchain file set CMAKE_SYSTEM_NAME to "Integrity". CMake's module directory takes precedence, when loading platform modules. This is special for platform modules and different from the documented behavior of CMAKE_MODULE_PATH and include(). In case the user wants to provide their own platform modules via CMAKE_MODULE_PATH, they can instruct Qt to not add its path by setting QT_AVOID_CUSTOM_PLATFORM_MODULES to ON. Make sure that configure tests with project files also load the custom platform module. Pick-to: 6.2 Fixes: QTBUG-96998 Change-Id: I9855d620d24dc66353cec5e847a2675b464ace26 Reviewed-by: Alexandru Croitor --- cmake/QtAutoDetect.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmake/QtAutoDetect.cmake') diff --git a/cmake/QtAutoDetect.cmake b/cmake/QtAutoDetect.cmake index 128a882b8d..ce87560a85 100644 --- a/cmake/QtAutoDetect.cmake +++ b/cmake/QtAutoDetect.cmake @@ -433,6 +433,12 @@ function(qt_auto_detect_integrity) endif() endfunction() +# Let CMake load our custom platform modules. +# CMake-provided platform modules take precedence. +if(NOT QT_AVOID_CUSTOM_PLATFORM_MODULES) + list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/platforms") +endif() + qt_auto_detect_cmake_generator() qt_auto_detect_cyclic_toolchain() qt_auto_detect_cmake_config() -- cgit v1.2.3