|
1 | 1 | # Project Setup
|
2 | 2 |
|
3 |
| -There are two recommended ways to set up your workstation in order to develop `gtk-rs` applications. |
4 |
| -Let us go through them one by one. |
5 |
| - |
6 |
| -## Cargo |
7 |
| - |
8 |
| -[Cargo](https://doc.rust-lang.org/cargo/index.html) is Rust's build system and package manager. |
9 |
| -If following the book is all you care about, using only Cargo will work fine for you. |
10 |
| - |
11 | 3 | Let us begin by installing all necessary tools.
|
12 | 4 | First, follow the instructions on the [GTK website](https://www.gtk.org/docs/installations/) in order to install GTK 4.
|
13 | 5 | Then install Rust with [rustup](https://rustup.rs/).
|
@@ -40,34 +32,3 @@ Now, you can run your application by executing:
|
40 | 32 | ```bash
|
41 | 33 | cargo run
|
42 | 34 | ```
|
43 |
| -
|
44 |
| -## Cargo + Meson |
45 |
| - |
46 |
| -Cargo is *almost* enough, but it is not well suited for handling resources such as icons or UI definition files. |
47 |
| -That is why we recommend to use [Meson](https://mesonbuild.com/) on top of it. |
48 |
| -It is cross-platform, and its syntax is very readable. |
49 |
| -Meson takes care of |
50 |
| -- translations, |
51 |
| -- building and installing [resources](resources.html) as well as |
52 |
| -- installing auxiliary files such as icons and [settings schemas](settings.html). |
53 |
| - |
54 |
| -Here as well, you first follow the instructions on the [GTK website](https://www.gtk.org/docs/installations/) in order to install GTK 4. |
55 |
| -Then install Rust with [rustup](https://rustup.rs/). |
56 |
| -Finally, install Meson by following the instructions on the [Meson website](https://mesonbuild.com/Getting-meson.html). |
57 |
| - |
58 |
| -You can download a ready-to-use gtk-rust-template [here](https://gitlab.gnome.org/bilelmoussaoui/gtk-rust-template). |
59 |
| -Follow the instructions in the README to initialize your own application. |
60 |
| -Then configure your project. |
61 |
| -```bash |
62 |
| -meson setup builddir |
63 |
| -``` |
64 |
| - |
65 |
| -In order to compile and install it run the following command. |
66 |
| -You have to execute it every time you modify your application. |
67 |
| -```bash |
68 |
| -meson install -C builddir |
69 |
| -``` |
70 |
| - |
71 |
| -Now, the application should be in a folder included in your system path. |
72 |
| -You can either start it with the application launcher of your choice or from within your terminal. |
73 |
| - |
0 commit comments