summaryrefslogtreecommitdiff
path: root/archived/projt-launcher/docs/contributing/GETTING_STARTED.md
blob: ac25232f28c731d4d4028a316724a012940dbf94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# Getting Started

Guide to setting up your development environment for ProjT Launcher.

---

## Prerequisites

### Required Tools

| Tool | Version | Purpose |
|------|---------|---------|
| CMake | 3.22+ | Build system |
| Qt | 6.8.0+ | GUI framework |
| Compiler | C++20 | GCC 11+, Clang 14+, MSVC 2022 |
| Ninja | 1.10+ | Build tool |
| Git | 2.30+ | Version control |

### Optional Tools

| Tool | Purpose |
|------|---------|
| clang-format | Code formatting |
| clang-tidy | Static analysis |
| Valgrind | Memory checking (Linux) |

---

## Clone Repository

```sh
# Fork on GitHub first, then:
git clone https://github.com/YourName/ProjT-Launcher.git
cd ProjT-Launcher

# Add upstream remote
git remote add upstream https://github.com/Project-Tick/ProjT-Launcher.git
```

---

## Platform Setup

### Windows

**Visual Studio 2022**:

1. Install VS 2022 with "Desktop development with C++"
2. Install Qt 6.8.0+ via Qt Online Installer
   - Select MSVC 2022 64-bit
   - Select Qt Shader Tools
3. Install dependencies via NuGet (required for CI parity):

```powershell
nuget install ./packages.config -OutputDirectory dependencies
```

**Note**: NuGet dependencies are mandatory for Windows builds to ensure CI reproducibility.

### Linux

**Nix (Recommended)**:

```sh
nix develop .#default
```

**Manual**:

```sh
# Debian/Ubuntu
sudo apt install cmake ninja-build qt6-base-dev qt6-tools-dev

# Fedora
sudo dnf install cmake ninja-build qt6-qtbase-devel qt6-qttools-devel

# Arch
sudo pacman -S cmake ninja qt6-base qt6-tools
```

### macOS

**Nix (Recommended)**:

```sh
nix develop .#default
```

**Homebrew**:

```sh
brew install cmake ninja qt@6
```

---

## Build

### Configure

```sh
# List available presets
cmake --list-presets

# Windows
cmake --preset windows_msvc

# Linux
cmake --preset linux

# macOS
cmake --preset macos
```

### Build

```sh
# Debug (development)
cmake --build --preset <preset> --config Debug

# Release (production)
cmake --build --preset <preset> --config Release
```

### Run

```sh
# Windows (MSVC preset)
./build/windows_msvc/Debug/ProjT-Launcher.exe

# Linux
./build/linux/Debug/ProjT-Launcher

# macOS
./build/macos/Debug/ProjT-Launcher.app/Contents/MacOS/ProjT-Launcher
```

### Test

```sh
ctest --preset <preset> --output-on-failure
```

---

## IDE Setup

### VS Code (Recommended)

Extensions:
- C/C++ (Microsoft)
- CMake Tools (Microsoft)
- clangd (LLVM)

Settings (`.vscode/settings.json`):

```json
{
  "cmake.configureOnOpen": true,
  "cmake.generator": "Ninja"
}
```

### Qt Creator

1. Open `CMakeLists.txt` as project
2. Select Qt 6.8.0+ kit
3. Import `.clang-format` in Tools > Options > C++ > Code Style

### Visual Studio 2022

1. File > Open > CMake
2. Select `CMakeLists.txt`
3. Configure Qt path in CMake settings

---

## Troubleshooting

### Qt not found

```sh
cmake --preset <preset> -DCMAKE_PREFIX_PATH="/path/to/Qt/6.8.0/gcc_64"
```

### Wrong Qt minor version

CI requires exact Qt version match. Check `cmake/versions.cmake` for the required version. Mismatched Qt versions cause ABI incompatibility.

### MSVC vs MinGW mismatch

Qt kit must match your compiler. Use MSVC kit with Visual Studio, MinGW kit with MinGW toolchain. Do not mix.

### clang-format version mismatch

Use the version specified in CI. Different versions produce different output. Check `.gitlab-ci.yml` and `.gitlab/ci/` for the expected version.

### Ninja not found

Install Ninja or use a different generator:

```sh
cmake -G "Unix Makefiles" ..
```

### C++20 not supported

Update your compiler:
- GCC: 11+
- Clang: 14+
- MSVC: 2022

---

## Next Steps

These documents must be read before submitting code:

- [Code Style](./CODE_STYLE.md) - Formatting rules
- [Project Structure](./PROJECT_STRUCTURE.md) - Where files go
- [Architecture](./ARCHITECTURE.md) - How components interact
- [Workflow](./WORKFLOW.md) - Git workflow and PR process