Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
6.0.0 Beta4
Description
Suppose a user creates a Qt-based project with a CMakeLists.txt that is missing a call to cmake_minimum_required(VERSION 3.17) or higher.
Then a call like find_package(Qt6 COMPONENTS Core) will produce the following error
CMake Error at /home/jobor/Qt/dev-cmake/lib/cmake/Qt6/Qt6Dependencies.cmake:14 (list): list index: 3 out of range (-2, 1) Call Stack (most recent call first): /home/jobor/Qt/dev-cmake/lib/cmake/Qt6/Qt6Config.cmake:69 (include) CMakeLists.txt:4 (find_package)
instead of something more enlightening like "CMake version so-and-so required".
Solution: make sure that we do not access list elements beyond the list's end in the exported files.
The exported cmake files should work without setting policies / requiring any newer CMake features.
Attachments
Issue Links
- depends on
-
QTBUG-88700 Figure out how to set new CMake policies in all Qt repos without duplicating them in each repo
-
- Closed
-