Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake fails configuring against Qt 6.7.2 because required components are not explicitly listed #1643

Closed
badshah400 opened this issue Jul 27, 2024 · 1 comment · Fixed by #1644

Comments

@badshah400
Copy link
Contributor

badshah400 commented Jul 27, 2024

Starting from Qt 6.7.2, the find_package in src/app/CMakeLists.txt needs to list all necessary Qt6 components needed to build the app. Otherwise, we (openSUSE Tumbleweed) see error like the following when running cmake:

[   12s] + cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:STRING=/usr -DCMAKE_MESSAGE_LOG_LEVEL:STRING=STATUS -S . -B build -GNinja -DQT_DISABLE_RPATH:BOOL=ON '-DCMAKE_C_FLAGS:STRING=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wno-unused-variable' '-DCMAKE_CXX_FLAGS:STRING=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wno-unused-variable' '-DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--as-needed -Wl,--no-undefined' '-DCMAKE_MODULE_LINKER_FLAGS:STRING=-Wl,--as-needed -Wl,--no-undefined' '-DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--as-needed -Wl,--no-undefined' -DCMAKE_SKIP_INSTALL_RPATH=ON
[   12s] -- The CXX compiler identification is GNU 13.3.0
[   12s] -- Detecting CXX compiler ABI info
[   12s] -- Detecting CXX compiler ABI info - done
[   12s] -- Check for working CXX compiler: /usr/bin/c++ - skipped
[   12s] -- Detecting CXX compile features
[   12s] -- Detecting CXX compile features - done
[   12s] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[   12s] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
[   12s] -- Found Threads: TRUE
[   12s] Building unreleased code. Proceed at your own risk!
[   12s] Cannot find Git metadata, using static version string.
[   12s] Calculated Zeal version: 0.7.1-dev
[   12s] -- Performing Test HAVE_STDATOMIC
[   12s] -- Performing Test HAVE_STDATOMIC - Success
[   12s] -- Found WrapAtomic: TRUE
[   13s] -- Found OpenGL: /usr/lib64/libOpenGL.so
[   13s] -- Found WrapOpenGL: TRUE
[   13s] -- Found XKB: /usr/lib64/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
[   13s] -- Found WrapVulkanHeaders: /usr/include
[   13s] -- Found X11: /usr/include
[   13s] -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
[   13s] -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
[   13s] -- Looking for gethostbyname
[   13s] -- Looking for gethostbyname - found
[   13s] -- Looking for connect
[   13s] -- Looking for connect - found
[   13s] -- Looking for remove
[   13s] -- Looking for remove - found
[   13s] -- Looking for shmat
[   13s] -- Looking for shmat - found
[   14s] -- Found XCB_XCB: /usr/lib64/libxcb.so (found version "1.17.0")
[   14s] -- Found XCB_KEYSYMS: /usr/lib64/libxcb-keysyms.so (found version "0.4.1")
[   14s] -- Found XCB: /usr/lib64/libxcb.so;/usr/lib64/libxcb-keysyms.so (found version "1.17.0") found components: XCB KEYSYMS
[   14s] -- Found SQLite3: /usr/include (found version "3.46.0")
[   14s] -- Project executable name: zeal
[   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
[   14s] 
[   14s] 
[   14s] -- Configuring incomplete, errors occurred!
[   14s] error: Bad exit status from /var/tmp/rpm-tmp.ZwSSuE (%build)

This is fixed by the following patch (against zeal v0.7.1):

---
 src/app/CMakeLists.txt |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: zeal-0.7.1/src/app/CMakeLists.txt
===================================================================
--- zeal-0.7.1.orig/src/app/CMakeLists.txt
+++ zeal-0.7.1/src/app/CMakeLists.txt
@@ -1,4 +1,4 @@
-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()
badshah400 added a commit to badshah400/zeal that referenced this issue Jul 27, 2024
Fixes zealdocs#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.
@trollixx
Copy link
Member

trollixx commented Jul 28, 2024

I saw failed build but didn't have time to investigate. Kind of strange that this only affects Windows builds. Nevermind, our Linux builds are not using Qt 6.7.2.

trollixx pushed a commit that referenced this issue Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants