Skip to content

cmake: add find_dependency calls to config file#442

Open
iblech wants to merge 1 commit intoQtExcel:masterfrom
iblech:fix-cmake-find-dependency
Open

cmake: add find_dependency calls to config file#442
iblech wants to merge 1 commit intoQtExcel:masterfrom
iblech:fix-cmake-find-dependency

Conversation

@iblech
Copy link

@iblech iblech commented Feb 2, 2026

Gpt4all is a tool for locally running LLMs. It vendors (a modified version of an older version of) QXlsx. However, with current Qt, compilation of Gpt4all fails:

CMake Error at deps/QXlsx/QXlsx/CMakeLists.txt:167 (target_link_libraries):
  Target "QXlsx" links to:

    Qt6::GuiPrivate

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Using Claude Opus 4.5, @photm5 and I tracked this problem down to an issue in QXlsx. Unfortunately, we are not experts on Qt build infrastructure and cannot personally judge the appropriateness of this patch. However, we can confirm that Gpt4all builds and works nicely with it. Hence we submit this for your consideration :-) Thank you for your work on QXlsx!

Here is Claude's detailed description:

The generated QXlsxQt*Config.cmake was missing find_dependency() calls for Qt components. This causes build failures when consuming projects use find_package(QXlsxQt6) because Qt6::GuiPrivate (declared in INTERFACE_LINK_LIBRARIES) is not found.

Add find_dependency() for Core, Gui, and conditionally GuiPrivate (required for Qt 6.10+) following CMake package configuration best practices.

Fixes build failures with Qt 6.10+ where GuiPrivate became a separate CMake component (QTBUG-87776).

The generated QXlsxQt*Config.cmake was missing find_dependency() calls
for Qt components. This causes build failures when consuming projects
use find_package(QXlsxQt6) because Qt6::GuiPrivate (declared in
INTERFACE_LINK_LIBRARIES) is not found.

Add find_dependency() for Core, Gui, and conditionally GuiPrivate
(required for Qt 6.10+) following CMake package configuration best
practices.

Fixes build failures with Qt 6.10+ where GuiPrivate became a separate
CMake component (QTBUG-87776).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant