| Summary: | Impossible do build a qt program using kf5-networkmanager-qt with qmake | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Nicolas Carrier <carrier.nicolas0> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED MOVED | ||
| Severity: | normal | CC: | buildroot, carrier.nicolas0, yann.morin.1998 |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
The example qt network manager application
The default config used to reproduce the bug with the minimal example. |
||
Created attachment 7816 [details]
The example qt network manager application
Note: I'm originally using a custom buildroot version on top of the 2018.02.5, but I could reproduce the issue with the current master 0769f7fc4b3e47e05c9a7951aefa81a2dbaeab0d Created attachment 7821 [details]
The default config used to reproduce the bug with the minimal example.
The issue originally occurred with another buildroot workspace, for a real arm-based product.
The provided defconfig is the simplest I could make, to reproduce the issue in a minimal buildroot environment.
I will try to investigate tomorrow. I did not test with a QMake project, only with a CMake one. Could you try converting from qmake to cmake ? The CMakeLists.txt would look like this: cmake_minimum_required(VERSION 3.0) find_package(Qt5 REQUIRED COMPONENTS Gui DBus) find_package(KF5NetworkManagerQt REQUIRED) add_executable(qt-network-manager main.cpp) target_link_libraries(qt-network-manager Qt5::Gui Qt5::DBus KF5::NetworkManagerQt) This would help confirm the issue lies in the QMake files. Thank you very much for your report I'm going to try to convert the project to cmake. For now, the following .pro file QT -= gui QT += dbus network CONFIG += c++11 console link_pkgconfig PKGCONFIG += libnm SOURCES += main.cpp INCLUDEPATH = $$[QT_SYSROOT]/usr/include/KF5/NetworkManagerQt LIBS += -lKF5NetworkManagerQt target.path = / !isEmpty(target.path): INSTALLS += target allowed me to build (and run) both for desktop and in buildroot. So this proves at least that the result of the kf5-networkmanager-qt build works fine. With the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.0)
include(GNUInstallDirs)
find_package(Qt5 REQUIRED COMPONENTS Gui DBus Network)
find_package(KF5NetworkManagerQt REQUIRED)
add_executable(qt-network-manager main.cpp)
target_link_libraries(qt-network-manager Qt5::Gui Qt5::DBus KF5::NetworkManagerQt)
install(TARGETS qt-network-manager DESTINATION ${CMAKE_INSTALL_BINDIR})
and test-qt-networkmanager.mk:
TEST_QT_NETWORKMANAGER_VERSION = 0.0.1
TEST_QT_NETWORKMANAGER_SITE_METHOD = local
TEST_QT_NETWORKMANAGER_SITE = $(BR2_EXTERNAL_SPECTRACOM_PATH)/../test-qt-networkmanager-src
TEST_QT_NETWORKMANAGER_DEPENDENCIES = kf5-networkmanager-qt
$(eval $(cmake-package))
It builds fine.
I can't use the cmake solution though, because I need to use NetworkManagerQt is an already existing and quite complex, qmake-based project, which I'd like to avoid converting to cmake if possible.
Thank you for testing. My message was not to imply you had to convert your project to CMake, I'm well too aware of the difficulty of such a task. It was just to make sure we identified the proper error. Sure, no problem, and in the meantime, I have to consider all the solutions. I'd really like to propose a patch directly, but I don't have a sufficient knowledge in qmake. I noticed that qt_lib_network.pri has its QT.network.includes variable parametered with $$QT_MODULE_INCLUDE_BASE, when for NetworkManagerQt, it's just: QT.NetworkManagerQt.includes = /usr/include/KF5/NetworkManagerQt Maybe something analogous should be done. But how ? As a buildroot patch ? I'm looking into it. I can not promise any timeline, but I sure hope to have a patch for you during the day. Excellent, there's no hurry, thank you very much ! After analysis and some checks (thanks Nicolas for your availability on IRC) it looks like there are two issues: - a bug in extra-cmake-modules that generates invalid pri when cross-building - wrong cmake settings on my side, thus putting files in wrong places I am still working on it and confident a solution will be found by tomorrow. Thank you for your report.
The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
https://gitlab.com/buildroot.org/buildroot/-/issues
We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.
Thank you!
|
When trying to build a minimal c++ code, making use of the kf5-networkmanager-qt library, I obtain the following error: Project ERROR: Unknown module(s) in QT: NetworkManagerQt There is a .pri file installed here: output/target/usr/mkspecs/modules/qt_NetworkManagerQt.pri Which doesn't seem to be taken into account. When cp-ed alongsidef the qt .pri files: cp ../output/target/usr/mkspecs/modules/qt_NetworkManagerQt.pri ../output/host/mkspecs/modules/ The build fails this time with the following error: i686-buildroot-linux-gnu-g++: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include/KF5/NetworkManagerQt' Which seems to indicate that either the pri file isn't used properly or that its content is buggy.