QT_HOST_PATH is required to *use* Qt (6.9.1) on RPi
-
I won't go into the pain and suffering of how I got Qt6.9.1 cross-compiled onto my RPi4 unless asked, but I eventually did it!
Now, when I try to load my project's CMake file in CLion (running on the RPi) I get:CMake error at <my pi qt path>/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake.278 (message): To use a cross-compiled Qt, please set the QT_HOST_PATH cache variable to the location of your Qt installation.
"To use a cross-compiled Qt"!
There's nothing in https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi about copying the host Qt installation across to the RPi.I tried setting QT_HOST_PATH to my RPi Qt location (the RPi is now the host after all), and I even started to copy the host Qt files across as they were asked for (in the hope that they won't actually be used) but I could see that this was going to go on forever so gave up.
What do I need to do in the process to prevent the Qt CMake infrastructure asking for host Qt files?
Thanks in advance.
-
I won't go into the pain and suffering of how I got Qt6.9.1 cross-compiled onto my RPi4 unless asked, but I eventually did it!
Now, when I try to load my project's CMake file in CLion (running on the RPi) I get:CMake error at <my pi qt path>/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake.278 (message): To use a cross-compiled Qt, please set the QT_HOST_PATH cache variable to the location of your Qt installation.
"To use a cross-compiled Qt"!
There's nothing in https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi about copying the host Qt installation across to the RPi.I tried setting QT_HOST_PATH to my RPi Qt location (the RPi is now the host after all), and I even started to copy the host Qt files across as they were asked for (in the hope that they won't actually be used) but I could see that this was going to go on forever so gave up.
What do I need to do in the process to prevent the Qt CMake infrastructure asking for host Qt files?
Thanks in advance.
@SwimRideRunCode said in QT_HOST_PATH is required to *use* Qt (6.9.1) on RPi:
running on the RPi
So, you want to use your cross-compiled Qt to build directly on Raspberry PI? Why? Cross compilation means you build on a host machine for another target machine. If you want to build directly on Raspberry PI you should build Qt there.
-
Sadly, I can't build Qt on the RPi. The many hours that it takes is longer than the RPi can survive it. My 8GB machine always ends up hanging after many hours and only 1/4 through the build.
(It would be nice if there were some Qt distributions for the RPi. That would avoid all of the pain being duplicated over and over by everyone.)
-
Well, I just tried apt install qt6-base-dev on my RPi (after seeing it listed in my Linux Mint package manager) and it's started installing. I'm using Ubuntu on the RPi.
OMG! What time I've wasted. I'll post back if it's all successful. -
Yep, I was able to install everything I need from Qt6 on RPi Ubuntu.
Setting...set(CMAKE_PREFIX_PATH "usr/lib/aarch64-linux-gnu/cmake/")
...allowed CMake to find everything.
Like one of my highschool maths teachers used to say, "Don't do it how I've shown you on the board."
-