Blame
|
1 | # Building Pointcaster |
||||||
| 2 | ||||||||
|
3 | Source code for Pointcaster is available on [Github](https://github.com/matth-av/pointcaster). Start by cloning the repository: |
||||||
|
4 | ```sh |
||||||
|
5 | git clone https://github.com/matth-av/pointcaster.git |
||||||
|
6 | cd pointcaster |
||||||
| 7 | ``` |
|||||||
|
8 | |||||||
|
9 | Builds use a containerised development environment that handles download and configuration of all dependencies. The [compose.yaml](https://github.com/matth-av/pointcaster/blob/qt/compose.yaml) in the root of the repository defines two services, `dev` for Linux and `dev-win` for Windows, which mount the repository inside the container and open a shell. Either [Docker](https://docs.docker.com/engine/install/) or [Podman](https://podman.io/docs/installation) (with `podman compose`) must be installed and configured on your system to proceed. |
||||||
|
10 | |||||||
|
11 | ## Linux |
||||||
|
12 | |||||||
|
13 | Start a development shell: |
||||||
|
14 | ```sh |
||||||
|
15 | docker compose run --rm dev |
||||||
|
16 | ``` |
||||||
|
17 | Or with Podman: |
||||||
|
18 | ```sh |
||||||
|
19 | podman compose run --rm dev |
||||||
|
20 | ``` |
||||||
|
21 | The container image is pulled from Pointcaster servers on first run. Or you can build it yourself from the [Dockerfile](https://github.com/matth-av/pointcaster/blob/qt/Dockerfile) (but it will take a while): |
||||||
|
22 | ```sh |
||||||
|
23 | docker build -t cr.pointcaster.net/pointcaster-dev:latest-linux . |
||||||
|
24 | ``` |
||||||
| 25 | ||||||||
|
26 | From inside the container, configure and build using `cmake`: |
||||||
|
27 | ```sh |
||||||
|
28 | cmake --preset linux-release |
||||||
|
29 | cmake --build build/linux-release |
||||||
|
30 | cmake --build build/linux-release --target install |
||||||
|
31 | cmake --build build/linux-release --target package |
||||||
|
32 | ``` |
||||||
| 33 | ||||||||
|
34 | The install target places a portable build at `build/linux-release/install/bin/pointcaster`, and the package target creates an AppImage at `dist/pointcaster-<version>-linux-release.AppImage`, both of which can be run from outside the container. |
||||||
|
35 | |||||||
| 36 | To produce a release package without opening a shell: |
|||||||
| 37 | ```sh |
|||||||
| 38 | docker compose run --rm dev ./scripts/build-linux-release.sh |
|||||||
| 39 | ``` |
|||||||
|
40 | > [!TIP] |
||||||
|
41 | > The same image is used as a base for a [Development Container](https://containers.dev/) in IDEs that support it. Visual Studio Code will automatically install extensions needed for C++, CMake and QML. See the [devcontainer.json](https://github.com/matth-av/pointcaster/blob/qt/.devcontainer/devcontainer.json). |
||||||
|
42 | |||||||
|
43 | ## Windows |
||||||
|
44 | ### Windows Builds Using Docker |
||||||
|
45 | Automated Windows builds use a Windows container with Visual Studio Build Tools and other binary dependencies installed by [`scripts/windows.Dockerfile`](https://github.com/matth-av/pointcaster/blob/qt/scripts/windows.Dockerfile). This is how release builds are produced, but if you are looking to develop Pointcaster or a Pointcaster plugin you'll most likely want to build and debug using an IDE - in which case you might prefer [installing dependencies manually](#windows-builds-in-an-ide). |
||||||
|
46 | |||||||
|
47 | The `dev-win` service requires Docker running Windows containers. It uses process isolation, so the host must be able to run Windows Server 2022 based images. |
||||||
|
48 | |||||||
|
49 | Start a development shell: |
||||||
|
50 | ```sh |
||||||
|
51 | docker compose run --rm dev-win |
||||||
|
52 | ``` |
||||||
|
53 | Or build the image yourself (but it will take a while): |
||||||
|
54 | ```sh |
||||||
|
55 | docker build -f scripts/windows.Dockerfile -t cr.pointcaster.net/pointcaster-dev:latest-windows . |
||||||
|
56 | ``` |
||||||
|
57 | |||||||
|
58 | And from inside the container: |
||||||
| 59 | ```sh |
|||||||
|
60 | cmake --preset windows-release |
||||||
|
61 | cmake --build build/windows-release |
||||||
|
62 | cmake --build build/windows-release --target install |
||||||
|
63 | cmake --build build/windows-release --target package |
||||||
|
64 | ``` |
||||||
|
65 | The install target places a portable build at `build/windows-release/install/pointcaster.exe`, and the package target creates a zip archive at `dist/pointcaster-<version>-windows-release.zip`. |
||||||
|
66 | |||||||
| 67 | To produce a release package without opening a shell: |
|||||||
| 68 | ```sh |
|||||||
| 69 | docker compose run --rm dev-win .\scripts\build-windows-release.ps1 |
|||||||
| 70 | ``` |
|||||||
|
71 | |||||||
|
72 | ### Windows Builds in an IDE |
||||||
|
73 | #### Development Dependencies |
||||||
|
74 | To build Pointcaster on Windows using an IDE like Visual Studio, you'll need to install the following libraries on your host: |
||||||
| 75 | - Qt ~~QtVersion~~, with the 'shadertools', 'quick3d' and 'tasktree' modules |
|||||||
| 76 | - oneAPI Threading Building Blocks (oneTBB) ~~TbbVersion~~ |
|||||||
| 77 | - Python ~~PythonVersion~~ |
|||||||
| 78 | - Jinja ~~Jinja2Version~~ |
|||||||
|
79 | - NVIDIA CUDA Toolkit ~~CudaVersion~~ |
||||||
|
80 | |||||||
|
81 | Additionally, your environment will need CMake, vcpkg, Ninja, and MSVC from Visual Studio 2022. |
||||||
|
82 | These are all included in Visual Studio's 'Desktop Development with C++' Workload. |
||||||
