How to Qt cross develop with CLion on remote
This is my first post.
Please forgive any unfamiliarity.
I am building and cross developing a Qt library for PinePhone / Raspberry Pi.
This post describes the procedure for cross-developing Qt in CLion.
(x86_64 <--> AArch64)
This article requires that you have already built and installed the x64 - AArch 64 Qt 6 library.
If you have any problems with this posting, please let me know.
== Tool Chain Setup ==
Select [+].
[Name] : Enter any name you wish.
[CMake] : Enter the path to the CMake file used to build the Qt library.
[Build Tool] : Enter the path to the Ninja file used to build the Qt library.
[C Compiler] : Enter the path to the GCC file used to build the Qt library.
[C++ Compiler] : Enter the path to the G++ file used to build the Qt library.
[Debugger] : Enter the path to the GDB file for the GCC tool chain.
== CMake Setup ==
Select [+].
[Name] : Enter any name you wish.
[Build type] : "Debug" or "Release".
[Toolchain] : Select the tool chain name set above.
[Generator] : I use "Use default".
[Environment] : Set the following items
* CMAKE_C_COMPILER
*: Enter the path to the GCC file used to build the Qt library.
* CMAKE_CXX_COMPILER
*: Enter the path of the G++ file used to build the Qt library.
* CMAKE_PREFIX_PATH
*: Enter the path to the Qt library installation directory.
* CMAKE_TOOLCHAIN_FILE
*: Enter the path of the toolchain file for the build in the Qt library installation directory.
* QT_QMAKE_EXECUTABLE
*: Enter the path of the qmake file located in the Qt library installation directory.
== SSH Setup ==
Select [+].
[Host] : Enter any name you wish.
[Username] : "Debug" or "Release".
[Authentication type] : Select the tool chain name set above.
[Private key file] : If the public key method is selected, the file path of the private key.
[Passphrase] : If you select the public key method and set a passphrase.
Finally, press the [Test Connection] button to make a test connection.
== Project Setup ==
[Run] menu-bar --> [Edit configurations...]
Select [+] --> [Remote GDB Server].
[Target] : Select "project name".
[Executable] : Select "project name".
[GDB] : Select the GDB file for the GCC tool chain.
[Credentials] : Select the SSH settings set above.
[Upload path] : Enter the path where the executable binary file created by CLion is located.
[GDB Server args] : It may be necessary to pass "-platform wayland" or "-platform xcb" as an argument when starting the program.
[Environment variables] : Set the following items
* DISPLAY
*: :0
* QT_QPA_PLATFORMTHEME
*: If Qt 6 : qt6ct
* PATH
*: Enter the path to the bin directory where you uploaded the Qt6 library.
* LD_LIBRARY_PATH
*: Enter the path to the lib directory where you uploaded the Qt6 library.
* QT_PLUGIN_PATH
*: /<directory where you uploaded Qt6 library>/plugins
* QT_QPA_PLATFORM_PLUGIN_PATH
*: /<directory where you uploaded Qt6 library>/plugins/platforms
* QML_IMPORT_PATH
*: /<directory where you uploaded Qt6 library>/qml
* QML2_IMPORT_PATH
*: /<directory where you uploaded Qt6 library>/qml
* LANG
*: Example1: To set English, enter en_US.UTF-8.
*: Example2: To set Japanese, enter ja_JP.UTF-8.
== Debugging ==
Let's build & Debug.
Please sign in to leave a comment.