Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 6.1.1
-
Fix Version/s: 6.1.3, 6.2.0 Beta2, 6.3.0 Alpha
-
Component/s: Build System: CMake
-
Labels:None
-
Environment:OS: Arch Linux
-
Commits:478f5fcde66a49b710c427447916a0ee0e4d9e0a (qt/qtbase/dev) b33913318ba43addb28acf1c5326cbbf454b1bbe (qt/qtbase/6.2) 943b561c329f7a893cd09517a52ee9fbd004f420 (qt/qtbase/6.1)
Description
Issue:
When both the "INSTALL_MKSPECSDIR" and "QT_QMAKE_TARGET_MKSPEC" variables are provided, building the Qt fails if it has been configured more than two times. This probably impacts previous versions too.
Reproduction:
- Run this twice:
cmake {qt5_source_dir} -G Ninja \ -DQT_QMAKE_TARGET_MKSPEC=linux-g++ \ -DINSTALL_MKSPECSDIR=install/archdatadir/mkspecs
- Build:
cmake --build . -v -j
- Compiling every translation unit fails with:
/home/tibo/Downloads/qt5/qtbase/src/corelib/io/qfilesystemmetadata_p.h:54:10: fatal error: qplatformdefs.h: No such file or directory
54 | #include "qplatformdefs.h"
Causes:
The variable "
QT_DEFAULT_PLATFORM_DEFINITION_DIR_ABSOLUTE" is defined differently in "QtBuild.cmake" depending on whether "QT_PLATFORM_DEFINITION_DIR" is defined or not. The second time the project is configured, "QT_PLATFORM_DEFINITION_DIR" is is the cache (and defined) and the "QT_DEFAULT_PLATFORM_DEFINITION_DIR_ABSOLUTE" is set to a non-existing directory.