I’ve been digging on this issue for a few days and have hit a wall beyond my control using Ubuntu 22.04 under WSL2 on up-to-date Windows 11. In typing all this up, I finally got the local build to work, but only with a hack around dependency problems.
I’m porting a VSCode extension v1, qmake qt5 project to the new V2 extension, cmake qt6 build tool.
The code is compiling in Qt6.2 and Qt6.6, build-debug-arm
will build an executable for linux/arm7
.
However, when I try to run build-debug-amd64-local
, cmake fails at find_package
on the library SerialBus
(CAN and more) on the “native” Ubuntu.
Here’s the entire output:
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBusTools/Qt6SerialBusToolsTargets.cmake:86 (message):
The imported target "Qt6::canbusutil" references the file
"/usr/lib/qt6/bin/canbusutil"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBusTools/Qt6SerialBusToolsTargets.cmake"
but not all the files it references.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBusTools/Qt6SerialBusToolsConfig.cmake:47 (include)
/usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBus/Qt6SerialBusDependencies.cmake:76 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBus/Qt6SerialBusConfig.cmake:50 (include)
/usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:219 (find_package)
CMakeLists.txt:10 (find_package)
CMake Warning at /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake:219 (find_package):
Found package configuration file:
/usr/lib/x86_64-linux-gnu/cmake/Qt6SerialBus/Qt6SerialBusConfig.cmake
but it set Qt6SerialBus_FOUND to FALSE so package "Qt6SerialBus" is
considered to be NOT FOUND.
Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
Now I’ve already made sure that libqt6serialbus6-dev
(and all libqt6serialbus6-*
) packages are installed on the host. QtCreator and Qt6 are all installed and usable for other projects via WSL2.
My first guess was maybe the package qt6-serialbus-dev
, which is not available in the repos till 23.01, thus not on the host debian, was allowing the arm build to succeed, but removing it from torizonPackages.json
doesnt break the arm build. Somehow, torizonPackages.json
is able to install qt6-serialbus-dev
on the build container no problem (but not find libqt6serialbus6-plugins
???)
Hacking on it a bit, if I link /usr/lib/qt6/bin/canbusutil
to a copy of canbusutil
from one of the several other Qt installs on my machine, cmake does build the native app, but only after installing libqt6serialport6-dev
, which isn’t a dependency for the amd64 libqt6serialbus6-dev
, but maybe isn’t needed by the armv7 version? (or is already installed? or is a dependency?..)
Now this is not an immediate show stopper, because I can still build the qmake project directly via msys2 for desktop development, but it is unfeasibly dangerous to have to maintain two separate build systems for the project.
I can also run the cmake build via open-in-qt-creator
, but only after fixing the Qt::SerialPort dep, and hacking in sudo ln -s /mnt/c/Qt/6.6.2/mingw_64/bin/canbusutil.exe /usr/lib/qt6/bin/canbusutil
which should get figured out by package and build tool maintainers. Maybe its a minor version problem? e.g. 6.2 vs 6.6?