File: Compile.md

package info (click to toggle)
xournalpp 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,036 kB
  • sloc: cpp: 64,137; xml: 939; sh: 752; ansic: 362; python: 338; php: 74; makefile: 15
file content (58 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download | duplicates (2)
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
# Compilation and Testing

This file contains platform-independent instructions for compiling and developing locally. For instructions on how to create platform-specific packages, or instructions on preliminary steps for building Xournal++, please see these platform-specific instructions:

- [LinuxBuild.md](./LinuxBuild.md)
- [MacBuild.md](./MacBuild.md)
- [WindowsBuild.md](./WindowsBuild.md)

## Get sources

```sh
git clone http://github.com/xournalpp/xournalpp
cd xournalpp
```

## Compile
For testing purposes, install in a subdirectory:

```sh
mkdir build
cd build

cmake .. -DCMAKE_INSTALL_PREFIX=install

cmake --build . # For a faster build, set the flag -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build . --target install
```

- Use `cmake-gui ..` to graphically configure CMake
- Running without building the `install` target will most likely not work, as
some resources need to be generated and located in the right directories.

## Run

```sh
# Before running this command, ensure you're in the './build' directory
./install/bin/xournalpp
```

## Test

The unit tests can be enabled by setting `-DENABLE_GTEST=on` when running the
CMake command. This requires having `googletest` available, either through your
system's package manager or by setting `-DDOWNLOAD_GTEST=on` to automatically
download and build `googletest`.

```sh
mkdir build
cd build

cmake .. -DENABLE_GTEST=on

# Build unit test executables
cmake --build . --target test-units

# Run unit tests
cmake --build . --target test
```