Skip to content

Commit

Permalink
cppQML: Add the hardware acceleration support for the Qt template
Browse files Browse the repository at this point in the history
Add the hardware acceleration support for the Qt template, by
using the newly release Torizon Qt6 containers (torizon/qt6-wayland and
torizon/qt6-wayland-vivante).
Also change the build tool from qmake6 to cmake, because at the moment
the "quick" module when added through qmake6 (in the .pro file),
adds the requirement of libGLX on the Makefile, which is not available
for the iMX8 modules.
Therefore, before it gets fixed, to use qmake6 you have remove the
/usr/lib/aarch64-linux-gnu/libGLX.so from the LIBS of the Makefile
generated by qmake6 before running "make". Because of that, the
recommended way is to use CMake, the default of this new
hardware accelerated Qt6 template.

Signed-off-by: Andre Riesco <andre.riesco@toradex.com>
  • Loading branch information
andreriesco authored and microhobby committed Oct 18, 2023
1 parent 12b6ca4 commit 86667f4
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 96 deletions.
2 changes: 1 addition & 1 deletion cppQML/.conf/deps.json
Expand Up @@ -7,7 +7,7 @@
"gdb",
"gdb-multiarch",
"g++",
"qmake6",
"cmake",
"qt6-base-dev",
"qt6-declarative-dev",
"netcat-traditional",
Expand Down
1 change: 1 addition & 0 deletions cppQML/.gitignore
Expand Up @@ -9,3 +9,4 @@ amd64
.qt
credentials.zip
*.lock.yml
build-*
2 changes: 1 addition & 1 deletion cppQML/.vscode/extensions.json
@@ -1,7 +1,7 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.makefile-tools",
"twxs.cmake",
"seanwu.vscode-qt-for-python"
]
}
8 changes: 4 additions & 4 deletions cppQML/.vscode/launch.json
Expand Up @@ -5,7 +5,7 @@
"name": "Local AMD64",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/x86_64/debug/__change__",
"program": "${workspaceFolder}/build-local/debug/__change__",
"args": [
],
"stopAtEntry": false,
Expand Down Expand Up @@ -49,7 +49,7 @@
],
"externalConsole": false,
"sourceFileMap": {
"/app/amd64": "${workspaceFolder}/amd64"
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
Expand Down Expand Up @@ -104,7 +104,7 @@
],
"externalConsole": false,
"sourceFileMap": {
"/app/aarch64": "${workspaceFolder}/aarch64"
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
Expand Down Expand Up @@ -159,7 +159,7 @@
],
"externalConsole": false,
"sourceFileMap": {
"/app/armhf": "${workspaceFolder}/armhf"
"/app": "${workspaceFolder}"
},
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
Expand Down
128 changes: 66 additions & 62 deletions cppQML/.vscode/tasks.json
Expand Up @@ -292,15 +292,13 @@
}
},
{
"label": "run-qmake-debug-amd64-local",
"label": "build-configure-amd64-local",
"hide": true,
"command": "qmake6",
"command": "cmake",
"type": "shell",
"args": [
"-o",
"x86_64/Makefile",
"CONFIG+=debug",
"CONFIG+=qml_debug"
"-DCMAKE_BUILD_TYPE=Debug",
"-B${workspaceFolder}/build-local"
],
"problemMatcher": [
"$gcc"
Expand All @@ -312,13 +310,12 @@
},
{
"label": "build-debug-amd64-local",
"detail": "Build the application debug for amd64 using the\ndevelopment host toolchain.",
"command": "make",
"detail": "Build a debug version of the application for amd64 using\nthe toolchain installed in the host.",
"command": "cmake",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/x86_64"
},
"args": [
"--build",
"${workspaceFolder}/build-local"
],
"problemMatcher": [
"$gcc"
Expand All @@ -329,18 +326,18 @@
},
"dependsOrder": "sequence",
"dependsOn": [
"run-qmake-debug-amd64-local",
"copy-assets-amd64-local"
"build-configure-amd64-local"
]
},
},
{
"label": "clean-amd64-local",
"command": "make",
"label": "clean-local",
"detail": "Clean the local application build directory.",
"command": "cmake",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/x86_64"
},
"args": [
"--build",
"build-local",
"--target",
"clean"
],
"problemMatcher": [
Expand All @@ -352,7 +349,7 @@
}
},
{
"label": "run-qmake-debug-arm64",
"label": "build-configure-arm64",
"hide": true,
"command": "DOCKER_HOST=",
"type": "shell",
Expand All @@ -364,9 +361,11 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm64-__container__",
"bash",
"-c",
"qmake6 -o aarch64/Makefile CONFIG+=debug CONFIG+=qml_debug"
"cmake",
"-DCMAKE_BUILD_TYPE=Debug",
"-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++",
"-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc",
"-Bbuild-arm64"
],
"problemMatcher": [
"$gcc"
Expand All @@ -382,7 +381,7 @@
},
{
"label": "build-debug-arm64",
"detail": "Build the application debug for arm64 using the\ncontainer SDK toolchain.",
"detail": "Build a debug version of the application for arm64 using\nthe toolchain from the SDK container.",
"command": "DOCKER_HOST=",
"type": "shell",
"args": [
Expand All @@ -393,9 +392,9 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm64-__container__",
"bash",
"-c",
"cd aarch64 && make -j12"
"cmake",
"--build",
"build-arm64"
],
"problemMatcher": [
"$gcc"
Expand All @@ -406,8 +405,7 @@
},
"dependsOrder": "sequence",
"dependsOn": [
"run-qmake-debug-arm64",
"copy-assets-arm64"
"build-configure-arm64"
]
},
{
Expand All @@ -423,9 +421,11 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm64-__container__",
"bash",
"-c",
"\"cd aarch64 && make clean\""
"cmake",
"--build",
"build-arm64",
"--target",
"clean"
],
"problemMatcher": [
"$gcc"
Expand Down Expand Up @@ -455,7 +455,7 @@
"-P",
"${config:torizon_debug_ssh_port}",
"-pr",
"${workspaceFolder}/aarch64/debug",
"${workspaceFolder}/build-arm64/debug",
"${config:torizon_run_as}@${config:torizon_ip}:~/app"
],
"dependsOn": [
Expand All @@ -480,7 +480,7 @@
}
},
{
"label": "run-qmake-debug-arm",
"label": "build-configure-arm",
"hide": true,
"command": "DOCKER_HOST=",
"type": "shell",
Expand All @@ -492,9 +492,11 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm-__container__",
"bash",
"-c",
"\"qmake6 -o armhf/Makefile CONFIG+=debug CONFIG+=qml_debug\""
"cmake",
"-DCMAKE_BUILD_TYPE=Debug",
"-DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++",
"-DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc",
"-Bbuild-armhf"
],
"problemMatcher": [
"$gcc"
Expand All @@ -510,7 +512,7 @@
},
{
"label": "build-debug-arm",
"detail": "Build the application debug for armhf using the\ncontainer SDK toolchain.",
"detail": "Build a debug version of the application for armhf using\nthe toolchain from the SDK container.",
"command": "DOCKER_HOST=",
"type": "shell",
"args": [
Expand All @@ -521,9 +523,9 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm-__container__",
"bash",
"-c",
"\"cd armhf && make -j12\""
"cmake",
"--build",
"build-armhf"
],
"problemMatcher": [
"$gcc"
Expand All @@ -534,8 +536,7 @@
},
"dependsOrder": "sequence",
"dependsOn": [
"run-qmake-debug-arm",
"copy-assets-arm"
"build-configure-arm"
]
},
{
Expand All @@ -551,9 +552,11 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-arm-__container__",
"bash",
"-c",
"\"cd armhf && make clean\""
"cmake",
"--build",
"build-armhf",
"--target",
"clean"
],
"problemMatcher": [
"$gcc"
Expand Down Expand Up @@ -583,7 +586,7 @@
"-P",
"${config:torizon_debug_ssh_port}",
"-pr",
"${workspaceFolder}/armhf/debug",
"${workspaceFolder}/build-armhf/debug",
"${config:torizon_run_as}@${config:torizon_ip}:~/app"
],
"dependsOn": [
Expand All @@ -608,7 +611,7 @@
}
},
{
"label": "run-qmake-debug-amd64",
"label": "build-configure-amd64",
"hide": true,
"command": "DOCKER_HOST=",
"type": "shell",
Expand All @@ -620,9 +623,9 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-amd64-__container__",
"bash",
"-c",
"\"qmake6 -o amd64/Makefile CONFIG+=debug CONFIG+=qml_debug\""
"cmake",
"-DCMAKE_BUILD_TYPE=Debug",
"-Bbuild-amd64"
],
"problemMatcher": [
"$gcc"
Expand All @@ -638,7 +641,7 @@
},
{
"label": "build-debug-amd64",
"detail": "Build the application debug for amd64 using the\ncontainer SDK toolchain.",
"detail": "Build a debug version of the application for arm64 using\nthe toolchain from the SDK container.",
"command": "DOCKER_HOST=",
"type": "shell",
"args": [
Expand All @@ -649,9 +652,9 @@
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-amd64-__container__",
"bash",
"-c",
"\"cd amd64 && make -j12\""
"cmake",
"--build",
"build-amd64"
],
"problemMatcher": [
"$gcc"
Expand All @@ -662,8 +665,7 @@
},
"dependsOrder": "sequence",
"dependsOn": [
"run-qmake-debug-amd64",
"copy-assets-amd64"
"build-configure-amd64"
]
},
{
Expand All @@ -678,10 +680,12 @@
"-it",
"-v",
"${workspaceFolder}:/app",
"cross-toolchain-amd64-__change__",
"bash",
"-c",
"\"cd amd64 && make clean\""
"cross-toolchain-amd64-__container__",
"cmake",
"--build",
"build-amd64",
"--target",
"clean"
],
"problemMatcher": [
"$gcc"
Expand Down Expand Up @@ -711,7 +715,7 @@
"-P",
"${config:torizon_debug_ssh_port}",
"-pr",
"${workspaceFolder}/amd64/debug",
"${workspaceFolder}/build-amd64/debug",
"${config:torizon_run_as}@${config:torizon_ip}:~/app"
],
"dependsOn": [
Expand Down

0 comments on commit 86667f4

Please sign in to comment.