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 | ## Linux |
||||||
| 10 | ||||||||
|
11 | Builds on Linux use a containerised development environment created using the [Dockerfile](https://github.com/matth-av/pointcaster/blob/qt/Dockerfile) in the root of the repository. This handles download and configuration of all dependencies. Either [Docker](https://docs.docker.com/engine/install/) or [Podman](https://podman.io/docs/installation) must be installed and configured on your system to proceed. |
||||||
|
12 | |||||||
|
13 | The container image can be pulled from Pointcaster servers: |
||||||
|
14 | ```sh |
||||||
|
15 | docker pull cr.pointcaster.net/pointcaster-dev |
||||||
| 16 | ``` |
|||||||
| 17 | ||||||||
| 18 | Or you can build it yourself (but it will take a while): |
|||||||
| 19 | ```sh |
|||||||
| 20 | docker build -t pointcaster-dev . |
|||||||
| 21 | ``` |
|||||||
| 22 | ||||||||
| 23 | It can be run directly to create release builds: |
|||||||
| 24 | ```sh |
|||||||
| 25 | docker run --rm -it -v ./:/pointcaster:Z cr.pointcaster.net/pointcaster-dev ./scripts/build-linux-release.sh |
|||||||
|
26 | ``` |
||||||
|
27 | The `-v` argument ensures the repository is mounted inside the container. |
||||||
|
28 | |||||||
|
29 | For a development shell, invoke `bash` or `fish`, then you can configure and build using `cmake`: |
||||||
|
30 | ```sh |
||||||
|
31 | docker run --rm -it -v ./:/pointcaster:Z pointcaster-linux bash |
||||||
|
32 | ``` |
||||||
| 33 | Then from inside: |
|||||||
| 34 | ```sh |
|||||||
|
35 | cmake --preset linux-release |
||||||
|
36 | cmake --build build/linux-release |
||||||
|
37 | cmake --build build/linux-release --target install |
||||||
|
38 | cmake --build build/linux-release --target package |
||||||
|
39 | ``` |
||||||
| 40 | ||||||||
|
41 | The install target places a portable build at `build/linux-release/install/bin/pointcaster`, and the package target creates an AppImage at `build/linux-release/Pointcaster-Linux-<version>.AppImage`, both of which can be run from outside the container. |
||||||
|
42 | > [!TIP] |
||||||
|
43 | > The docker 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). |
||||||
|
44 | |||||||
|
45 | ## Windows |
||||||
|
46 | ### Windows Builds Using Docker |
||||||
|
47 | Automated Windows builds use [Docker](https://docs.docker.com/engine/install/) to configure the build environment. [`scripts/windows.Dockerfile`](https://github.com/matth-av/pointcaster/blob/qt/scripts/windows.Dockerfile) installs Visual Studio Build Tools and other binary dependencies in a Windows container. 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). |
||||||
|
48 | |||||||
|
49 | The following commands assume you have a working docker installation capable of running Windows containers on the command line. |
||||||
|
50 | |||||||
|
51 | To build the Windows docker image: |
||||||
|
52 | ```sh |
||||||
|
53 | docker build -f scripts/windows.Dockerfile -t pointcaster-win . |
||||||
|
54 | ``` |
||||||
|
55 | To produce a Pointcaster release package: |
||||||
|
56 | ``` |
||||||
|
57 | docker run -v ./:C:\pointcaster pointcaster-win .\scripts-build-windows-release.ps1 |
||||||
|
58 | ``` |
||||||
|
59 | The `-v` argument ensures the repository is mounted inside the container. |
||||||
| 60 | ||||||||
|
61 | For a development shell: |
||||||
| 62 | ``` |
|||||||
|
63 | docker run -it -v ./:C:\pointcaster pointcaster-win powershell |
||||||
|
64 | ``` |
||||||
|
65 | > [!TIP] |
||||||
| 66 | > You might benefit from passing some docker args to fully utilise available resources, e.g.: |
|||||||
| 67 | > ```sh |
|||||||
| 68 | > docker run --memory=20G --cpus=16 ... |
|||||||
| 69 | > ``` |
|||||||
| 70 | ||||||||
| 71 | And from inside the container: |
|||||||
| 72 | ```sh |
|||||||
|
73 | cmake --preset windows-release |
||||||
|
74 | cmake --build build/windows-release |
||||||
|
75 | cmake --build build/windows-release --target install |
||||||
|
76 | cmake --build build/windows-release --target package |
||||||
|
77 | ``` |
||||||
|
78 | ### Windows Builds in an IDE |
||||||
|
79 | #### Development Dependencies |
||||||
|
80 | To build Pointcaster on Windows using an IDE like Visual Studio, you'll need to install the following libraries on your host: |
||||||
| 81 | - Qt ~~QtVersion~~, with the 'shadertools', 'quick3d' and 'tasktree' modules |
|||||||
| 82 | - oneAPI Threading Building Blocks (oneTBB) ~~TbbVersion~~ |
|||||||
| 83 | - Python ~~PythonVersion~~ |
|||||||
| 84 | - Jinja ~~Jinja2Version~~ |
|||||||
| 85 | ||||||||
| 86 | Additionally, your environment will need CMake, MSVC from Visual Studio 2022, vcpkg and Ninja. |
|||||||
