Skip to content

Conversation

@Integral-Tech
Copy link
Contributor

According to What's New in Qt 6.10:

Usage of a private Qt module Foo now requires a call to find_package(Qt6 COMPONENTS FooPrivate) to make the Qt6::FooPrivate target available.

Otherwise, the build complains about:

CMake Error at CMakeLists.txt:354 (target_link_libraries):
  Target "Notes" links to:

    Qt6::CorePrivate

  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.

Copy link
Collaborator

@zjeffer zjeffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zjeffer zjeffer requested a review from guihkx October 10, 2025 15:25
@Integral-Tech Integral-Tech marked this pull request as draft October 10, 2025 15:27
@Integral-Tech Integral-Tech force-pushed the qt-6.10-private-mod branch 3 times, most recently from 4ab2d31 to 1b8501b Compare October 10, 2025 15:48
@Integral-Tech Integral-Tech marked this pull request as ready for review October 10, 2025 15:51
Copy link
Collaborator

@guihkx guihkx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this.

I think we can simplify these changes a bit...

Instead of 3 separate if statements, you could probably write it like this:

# https://doc.qt.io/qt-6/whatsnew610.html#build-system-changes
if(QT_VERSION VERSION_GREATER_EQUAL 6.10)
  list(APPEND QT_COMPONENTS CorePrivate GuiPrivate WidgetsPrivate)
endif()

This would have to go before the call to find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_COMPONENTS}).

@zjeffer
Copy link
Collaborator

zjeffer commented Oct 10, 2025

Thank you for working on this.

I think we can simplify these changes a bit...

Instead of 3 separate if statements, you could probably write it like this:

# https://doc.qt.io/qt-6/whatsnew610.html#build-system-changes
if(QT_VERSION VERSION_GREATER_EQUAL 6.10)
  list(APPEND QT_COMPONENTS CorePrivate GuiPrivate WidgetsPrivate)
endif()

This would have to go before the call to find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_COMPONENTS}).

This is how it was originally when I approved, not sure why it was changed 🤔

@guihkx
Copy link
Collaborator

guihkx commented Oct 10, 2025

Ah, I see...

Commit 0c9c248 had the changes I suggested, but it doesn't work with Qt 6.10 because it's not in the right place: The $QT_VERSION variable is still undefined in that "if" statement.

If we move the "if" statement just one line above find_package(Qt${QT_VERSION_MAJOR ..., as I suggested in my previous post, it builds just fine.

Usage of a private Qt module `Foo` requires a call to
`find_package(Qt6 COMPONENTS FooPrivate)` since Qt 6.10.
@Integral-Tech
Copy link
Contributor Author

Thank you for working on this.

I think we can simplify these changes a bit...

Instead of 3 separate if statements, you could probably write it like this:

# https://doc.qt.io/qt-6/whatsnew610.html#build-system-changes
if(QT_VERSION VERSION_GREATER_EQUAL 6.10)
  list(APPEND QT_COMPONENTS CorePrivate GuiPrivate WidgetsPrivate)
endif()

This would have to go before the call to find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QT_COMPONENTS}).

Thanks for your suggestion :)

@guihkx guihkx merged commit 1585918 into nuttyartist:master Oct 11, 2025
12 checks passed
@guihkx
Copy link
Collaborator

guihkx commented Oct 11, 2025

@Integral-Tech Thanks!

@zjeffer Can you add this as a patch to the notes AUR package? Thanks!

@Integral-Tech Integral-Tech deleted the qt-6.10-private-mod branch October 11, 2025 04:12
@zjeffer
Copy link
Collaborator

zjeffer commented Oct 11, 2025

@guihkx done: https://aur.archlinux.org/cgit/aur.git/commit/?h=notes&id=96e34dcabe19ed5a14f42e45640e65917a064966

@nuttyartist
Copy link
Owner

Thanks to all involved! @Integral-Tech @guihkx @zjeffer !

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.

4 participants