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

Add private include paths #955

Open
akiselev opened this issue May 19, 2024 · 1 comment
Open

Add private include paths #955

akiselev opened this issue May 19, 2024 · 1 comment
Labels
🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo ⬆️ feature New feature or request 🙋 good first issue Good for newcomers

Comments

@akiselev
Copy link

akiselev commented May 19, 2024

I'm trying to bind QT Advanced Docking System but i'm getting the following error:

Qt-Advanced-Docking-System/src/ads_globals.cpp:45:10: fatal error: qpa/qplatformnativeinterface.h: No such file or directory
    45 | #include <qpa/qplatformnativeinterface.h>
       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That header is in QtGui/6.7.0/QtGui/qpa/qplatformnativeinterface.h so I have a very hacky solution below that builds, but it'd be nice to have official support.

let version: qt_build_utils::SemVer = qtbuild.version().clone();
for path in qtbuild.include_paths() {
    let path = path.to_str().unwrap();
    if path.contains("QtGui") {
        cc.include(format!("{}/{}/QtGui", path, version));
    }
}
@ahayzen-kdab
Copy link
Collaborator

Thanks for taking the time to report this issue.

So this is a private header, but I believe under CMake this would be part of the QtGui Private target? Eg Qt::GuiPrivate in CMake ?

If so then yes I think we should try to add support for this somewhere, like by having a special case for "Private" in .qt_module so that .qt_module("GuiPrivate") does the right thing.

We'd have to investigate what the Qt CMake code is doing and then match that in qt-build-utils, an initial look appears to suggest this is a folder within the module itself eg /var/home/andrew/.var/Qt/6.5.2/gcc_64/include/QtGui/6.5.2/QtGui/private but i also note that the file you want is not under this private folder and instead under the version /var/home/andrew/.var/Qt/6.5.2/gcc_64/include/QtGui/6.5.2/QtGui/qpa/qplatformnativeinterface.h. So we should see what Qt CMake is doing.

@ahayzen-kdab ahayzen-kdab added ⬆️ feature New feature or request 🙋 good first issue Good for newcomers 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo ⬆️ feature New feature or request 🙋 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants