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 -t -v ./:/pointcaster:Z cr.pointcaster.net/pointcaster-dev \ |
||||||
| 26 | ./scripts/build-linux-release.sh |
|||||||
|
27 | ``` |
||||||
|
28 | The `-v` argument ensures the repository is mounted inside the container. |
||||||
|
29 | |||||||
|
30 | For a development shell, invoke `bash` or `fish`, then you can configure and build using `cmake`: |
||||||
|
31 | ```sh |
||||||
|
32 | docker run --rm -it -v ./:/pointcaster:Z cr.pointcaster.net/pointcaster-dev \ |
||||||
| 33 | bash |
|||||||
|
34 | ``` |
||||||
| 35 | Then from inside: |
|||||||
| 36 | ```sh |
|||||||
|
37 | cmake --preset linux-release |
||||||
|
38 | cmake --build build/linux-release |
||||||
|
39 | cmake --build build/linux-release --target install |
||||||
|
40 | cmake --build build/linux-release --target package |
||||||
|
41 | ``` |
||||||
| 42 | ||||||||
|
43 | 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. |
||||||
|
44 | > [!TIP] |
||||||
|
45 | > 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). |
||||||
|
46 | |||||||
|
47 | ## Windows |
||||||
|
48 | ### Windows Builds Using Docker |
||||||
|
49 | 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). |
||||||
|
50 | |||||||
|
51 | The following commands assume you have a working docker installation capable of running Windows containers on the command line. |
||||||
|
52 | |||||||
|
53 | To build the Windows docker image: |
||||||
|
54 | ```sh |
||||||
|
55 | docker build -f scripts/windows.Dockerfile -t pointcaster-win . |
||||||
|
56 | ``` |
||||||
|
57 | To produce a Pointcaster release package: |
||||||
|
58 | ``` |
||||||
|
59 | docker run -v ./:C:\pointcaster pointcaster-win .\scripts-build-windows-release.ps1 |
||||||
|
60 | ``` |
||||||
|
61 | The `-v` argument ensures the repository is mounted inside the container. |
||||||
| 62 | ||||||||
|
63 | For a development shell: |
||||||
| 64 | ``` |
|||||||
|
65 | docker run -it -v ./:C:\pointcaster pointcaster-win powershell |
||||||
|
66 | ``` |
||||||
|
67 | > [!TIP] |
||||||
| 68 | > You might benefit from passing some docker args to fully utilise available resources, e.g.: |
|||||||
| 69 | > ```sh |
|||||||
| 70 | > docker run --memory=20G --cpus=16 ... |
|||||||
| 71 | > ``` |
|||||||
| 72 | ||||||||
| 73 | And from inside the container: |
|||||||
| 74 | ```sh |
|||||||
|
75 | cmake --preset windows-release |
||||||
|
76 | cmake --build build/windows-release |
||||||
|
77 | cmake --build build/windows-release --target install |
||||||
|
78 | cmake --build build/windows-release --target package |
||||||
|
79 | ``` |
||||||
|
80 | ### Windows Builds in an IDE |
||||||
|
81 | #### Development Dependencies |
||||||
|
82 | To build Pointcaster on Windows using an IDE like Visual Studio, you'll need to install the following libraries on your host: |
||||||
| 83 | - Qt ~~QtVersion~~, with the 'shadertools', 'quick3d' and 'tasktree' modules |
|||||||
| 84 | - oneAPI Threading Building Blocks (oneTBB) ~~TbbVersion~~ |
|||||||
| 85 | - Python ~~PythonVersion~~ |
|||||||
| 86 | - Jinja ~~Jinja2Version~~ |
|||||||
| 87 | ||||||||
| 88 | Additionally, your environment will need CMake, MSVC from Visual Studio 2022, vcpkg and Ninja. |
|||||||
