-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmakeGTK4: Create Cpp GTK 4 template
Create a template for GTK 4, based on the cmakeConsole. Signed-off-by: Leonardo Graboski Veiga <[email protected]>
- Loading branch information
Showing
21 changed files
with
1,334 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"packages": [ | ||
"openssh-client", | ||
"sshpass", | ||
"build-essential", | ||
"cmake", | ||
"gdb", | ||
"g++", | ||
"libgtk-4-dev" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpQIBAAKCAQEAqpUaOa6i/TaSKwpdsHzLfGK95dDcFYpmYH5hUj0cBhVEVdl8 | ||
JAG0MEDcZsjQHiBlfUiHmyU2iOWBoKUytpMnzYF6ggdZBv5hBMv3RcTlnNijxzxg | ||
KvbjTm3LqAY8uu4SF9I8oDXVOn7xwZYgiC7s3XRGOP6TowSVEHsLB+cehWs4Y5io | ||
3BngOlcOYZtVrh+i3A7xSHWP7n2IetJEo5C425oaOCZXUJT2egau6ODmvBItZjpG | ||
mNdwVwrEI2H3o+LLI9tieNfyFcUFPNDRXbku1V0mXU9VjZ7WFihZXob11XNCEkY7 | ||
Bg3SpzTntSRn9hZD7i3xDU9MSJz90rnn56ID1wIDAQABAoIBACI239i7/3Mcc/rw | ||
DFSu4z2irIYg+1P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y | ||
Xwo3iUUCgYEAo/27Qkb5nOdL8sJwFggDrdB1pPrxXN20KmYCJF1P9wPDhnj1fJ7+ | ||
0Z/56XYzPA2rQx0vf5idvoGQ3KZS7QkOClLtcyevH3b38fnmAqv+dPLRHmrSd+3G | ||
BspdMlr3rwZK8RKwXjDzLYpwSvjmf7PTGTPO3C7WTzg+m0U9RbSJKi4= | ||
-----END RSA PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqlRo5rqL9NpIrCl2wfMt8Yr3l0NwVimZgfmFSPRwGFURV2XwkAbQwQNxmyNAeIGV9SIebJTaI5YGgpTK2kyfNgXqCB1kG/mEEy/dFxOWc2KPHPGAq9uNObcuoBjy67hIX0jygNdU6fvHBliCILuzddEY4/pOjBJUQewsH5x6FazhjmKjcGeA6Vw5hm1WuH6LcDvFIdY/ufYh60kSjkLjbmho4JldQlPZ6Bq7o4Oa8Ei1mOkaY13BXCsQjYfej4ssj22J41/IVxQU80NFduS7VXSZdT1WNntYWKFlehvXVc0ISRjsGDdKnNOe1JGf2FkPuLfENT0xInP3SuefnogPX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"source": "CMakeLists.txt", | ||
"target": "CMakeLists.txt" | ||
}, | ||
{ | ||
"source": ".vscode/c_cpp_properties.json", | ||
"target": ".vscode/c_cpp_properties.json" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# C++ CMake GTK 4 Template Specific Documentation | ||
|
||
> ⚠️ **WARNING:** This is just the documentation part specific of this template. **For the complete and general Torizon IDE documentation, check the [developer website documentation](https://developer.toradex.com/torizon/application-development/ide-extension/)** ⚠️ | ||
All projects follow the pipeline of tasks described in the [common contributing documentation](https://github.com/toradex/vscode-torizon-templates/blob/bookworm/CONTRIBUTING.md#contributing-templates). However, each project has its own specificities in terms of technologies and methods used to compile, deploy, and debug the code. Therefore, each of them has their own specific tasks in the `tasks.json` file. | ||
|
||
This C++ GTK 4 template uses `cmake` and `make` to compile the code, with tasks named `build-configure-\${architecture}` (creates the destination directory for the future compiled code and generates the Makefile, using `cmake`) and `build-debug-\${architecture}` (compiles the code). It also uses an SDK container to cross-compile the code. This container image is built using the `Dockerfile.sdk` file, and the tasks that build the containers are named `build-container-image-sdk-\${architecture}`. | ||
|
||
The compiled code is then copied into the container, in the `torizon_app_root` (which is automatically passed to the `APP_ROOT` variable in the `Dockerfiles`) directory defined at `settings.json`, through the Docker `COPY` command. | ||
|
||
The task that has the entire pipeline of executed tasks, from the first step to the last step before the debugging, is the `deploy-torizon-\${architecture}` task. | ||
|
||
Finally, remote debugging is performed by attaching to the GDB on the running container on the device using a [VSCode feature called Pipe Transport](https://code.visualstudio.com/docs/cpp/pipe-transport). For local debugging, the [VSCode method for C/C++ Debugging](https://code.visualstudio.com/docs/cpp/launch-json-reference) is used. The tasks that perform the debugging are those present in the `launch.json` file. | ||
|
||
The source code of the template is a simple GTK 3 Hello World (Hello Torizon, actually) in C++, using CMake as build system. | ||
|
||
## About GTK 4 | ||
|
||
To learn or use GTK 4, you must refer to the official [GTK 4 Documentation](https://www.gtk.org/docs/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
credentials.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
# Created by https://www.gitignore.io/api/c,c++,cmake | ||
|
||
### C ### | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
### C++ ### | ||
# Prerequisites | ||
|
||
# Compiled Object files | ||
*.slo | ||
|
||
# Precompiled Headers | ||
|
||
# Compiled Dynamic libraries | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
|
||
# End of https://www.gitignore.io/api/c,c++,cmake | ||
|
||
credentials.zip | ||
*.lock.yml | ||
|
||
#Build directories | ||
build-* | ||
|
||
.conf/.depok | ||
.conf/.docok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "__change__", | ||
"includePath": [ | ||
"${workspaceFolder}/includes/**", | ||
"/usr/include/**" | ||
], | ||
"intelliSenseMode": "linux-gcc-x64", | ||
"compilerPath": "/usr/bin/gcc", | ||
"cStandard": "gnu17", | ||
"cppStandard": "gnu++17" | ||
} | ||
], | ||
"version": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode.cpptools", | ||
"twxs.cmake" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Local AMD64", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/build-local/bin/__change__", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceRoot}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "build-debug-local" | ||
}, | ||
{ | ||
"name": "Torizon AMD64", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${config:torizon_app_root}/__change__", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${config:torizon_app_root}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"logging": { | ||
"engineLogging": false, // set this to true for a detailed log on the debug console | ||
}, | ||
"sourceFileMap": { | ||
"${config:torizon_app_root}": "${workspaceFolder}" | ||
}, | ||
"pipeTransport": { | ||
"debuggerPath": "/usr/bin/gdb", | ||
"pipeProgram": "ssh", | ||
"pipeArgs": [ | ||
"-T", | ||
"-q", | ||
"-p", | ||
"${config:torizon_debug_ssh_port}", | ||
"-o", | ||
"StrictHostKeyChecking=no", | ||
"-o", | ||
"UserKnownHostsFile /dev/null", | ||
"${config:torizon_run_as}@${config:torizon_ip}" // user@device | ||
] | ||
}, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "deploy-torizon-amd64" | ||
}, | ||
{ | ||
"name": "Torizon ARMv7", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${config:torizon_app_root}/__change__", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${config:torizon_app_root}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"logging": { | ||
"engineLogging": false, // set this to true for a detailed log on the debug console | ||
}, | ||
"sourceFileMap": { | ||
"${config:torizon_app_root}": "${workspaceFolder}" | ||
}, | ||
"pipeTransport": { | ||
"debuggerPath": "/usr/bin/gdb", | ||
"pipeProgram": "ssh", | ||
"pipeArgs": [ | ||
"-T", | ||
"-q", | ||
"-p", | ||
"${config:torizon_debug_ssh_port}", | ||
"-o", | ||
"StrictHostKeyChecking=no", | ||
"-o", | ||
"UserKnownHostsFile /dev/null", | ||
"${config:torizon_run_as}@${config:torizon_ip}" // user@device | ||
] | ||
}, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "deploy-torizon-arm" | ||
}, | ||
{ | ||
"name": "Torizon ARMv8", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${config:torizon_app_root}/__change__", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${config:torizon_app_root}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"logging": { | ||
"engineLogging": false, // set this to true for a detailed log on the debug console | ||
}, | ||
"sourceFileMap": { | ||
"${config:torizon_app_root}": "${workspaceFolder}" | ||
}, | ||
"pipeTransport": { | ||
"debuggerPath": "/usr/bin/gdb", | ||
"pipeProgram": "ssh", | ||
"pipeArgs": [ | ||
"-T", | ||
"-q", | ||
"-p", | ||
"${config:torizon_debug_ssh_port}", | ||
"-o", | ||
"StrictHostKeyChecking=no", | ||
"-o", | ||
"UserKnownHostsFile /dev/null", | ||
"${config:torizon_run_as}@${config:torizon_ip}" // user@device | ||
] | ||
}, | ||
"MIMode": "gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
}, | ||
{ | ||
"description": "Set Disassembly Flavor to Intel", | ||
"text": "-gdb-set disassembly-flavor intel", | ||
"ignoreFailures": true | ||
} | ||
], | ||
"preLaunchTask": "deploy-torizon-arm64" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"torizon_psswd": "", | ||
"torizon_login": "", | ||
"torizon_ip": "", | ||
"torizon_ssh_port": "", | ||
"host_ip": "", | ||
"torizon_workspace": "${workspaceFolder}", | ||
"torizon_debug_ssh_port": "2230", | ||
"torizon_debug_port1": "2232", | ||
"torizon_debug_port2": "2233", | ||
"torizon_debug_port3": "", | ||
"torizon_gpu": "", | ||
"torizon_arch": "", | ||
"wait_sync": "1", | ||
"torizon_run_as": "torizon", | ||
"torizon_app_root": "/home/torizon/app", | ||
"tcb.packageName": "__change__", | ||
"tcb.version": "3.11.0", | ||
"torizon.gpuPrefixRC": true, | ||
"terminal.integrated.defaultProfile.linux": "bash" | ||
} |
Oops, something went wrong.