From f4bf7982a679312146546fabfb086e801c2bbc37 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Wed, 12 Apr 2023 16:30:02 +0200 Subject: [PATCH] Make MODULE_ROOT Absolute In unity build, when calling qt-configure-module.bat, if we don't pass an absolute path, CMake will not be able to resolve the header paths in `*_cxx.cxx` unity headers. So far, this only happens on Windows/LLVM, and it is probably an oversight on CMake side, as passing a path without drive letter is perfectly fine in most cases, and CMake can handle it. We don't need the TO_CMAKE_PATH, as `get_filename_component` also does the transformation. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I474750af13291cbf1a46a12be5fc4a0f6e88accf Reviewed-by: Alexandru Croitor --- cmake/QtProcessConfigureArgs.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 0572fbbd5b8..8fa4be2af1a 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -54,7 +54,8 @@ if("${MODULE_ROOT}" STREQUAL "") get_filename_component(MODULE_ROOT ".." ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}") set(qtbase_or_top_level_build TRUE) else() - file(TO_CMAKE_PATH "${MODULE_ROOT}" MODULE_ROOT) + # If MODULE_ROOT is passed without drive letter, we try to add it to the path. + get_filename_component(MODULE_ROOT "." REALPATH BASE_DIR "${MODULE_ROOT}") set(qtbase_or_top_level_build FALSE) endif() set(configure_filename "configure.cmake")