Skip to content

Commit

Permalink
build: add missing Qt6 components to find_package.
Browse files Browse the repository at this point in the history
Fixes #1643.

Starting from Qt 6.7.2 it is necessary to list all necessary components
for Qt6 rather than deferring them. This commit fixes a build failure
when cmake configures a build against Qt >= 6.7.2, where we otherwise
see a failure like:

```
[   14s] CMake Error at
/usr/lib64/cmake/Qt6/QtPublicWalkLibsHelpers.cmake:259 (message):
[   14s]   The Concurrent target is mentioned as a dependency for
Registry, but not
[   14s]   declared.
[   14s] Call Stack (most recent call first):
[   14s]   /usr/lib64/cmake/Qt6/QtPublicWalkLibsHelpers.cmake:228
(__qt_internal_walk_libs)
[   14s]   /usr/lib64/cmake/Qt6/QtPublicWalkLibsHelpers.cmake:311
(__qt_internal_walk_libs)
[   14s]   /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:651
(__qt_internal_collect_all_target_dependencies)
[   14s]   /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:774
(_qt_internal_finalize_executable)
[   14s]   /usr/lib64/cmake/Qt6Core/Qt6CoreMacros.cmake:590:EVAL:1
(qt6_finalize_target)
[   14s]   src/app/CMakeLists.txt:DEFERRED
```

and so on for all missing components.
  • Loading branch information
badshah400 committed Jul 27, 2024
1 parent b9a25f2 commit c722b29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR}
COMPONENTS Concurrent Network WebChannel WebEngineWidgets Widgets
REQUIRED)
if (Qt${QT_VERSION_MAJOR}Widgets_VERSION VERSION_LESS QT_MINIMUM_VERSION)
message(FATAL_ERROR "Qt version >= ${QT_MINIMUM_VERSION} is required.")
endif()
Expand Down

0 comments on commit c722b29

Please sign in to comment.