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