bazel_rules_qt icon indicating copy to clipboard operation
bazel_rules_qt copied to clipboard

qt install path differs by linux distro (and by OS)

Open justbuchanan opened this issue 5 years ago • 2 comments

In order to use bazel_rules_qt in a bazel project, this must be added to the WORKSPACE fiile:

git_repository(
    name = "com_justbuchanan_rules_qt",
    remote = "https://github.com/justbuchanan/bazel_rules_qt",
    branch = "master",
    path = "QT_PATH",
)

On debian, QT_PATH should be "/usr/include/x86_64-linux-gnu/qt5" and on arch linux, QT_PATH is "/usr/include/qt". It's unfortunate that the WORKSPACE file must be modified depending on which system you're trying to build your app on. It would be nice to have bazel auto-detect this somehow.

justbuchanan avatar Feb 25 '20 03:02 justbuchanan

@justbuchanan In case you are interested, I started working on a way to autodetect the system https://github.com/limdor/bazel_rules_qt/pull/6, next step will be to read it from an environment variable https://github.com/limdor/bazel_rules_qt/issues/13

limdor avatar Jan 24 '21 14:01 limdor

That looks great! I have a project that I develop on a debian computer and an acrh linux computer, so being able to set QT_DIR and have it just work would be awesome (previously I was editing WORKSPACE). Especially nice that the repository_ctx approach easily adapts to use on windows.

justbuchanan avatar Feb 05 '21 06:02 justbuchanan