Skip to content

Commit 9f43570

Browse files
committed
Updated ReadMe with better build instructions
1 parent d30c3ca commit 9f43570

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ present.
1111

1212
### Build and install libprojectM
1313

14-
First, [build](https://github.com/projectM-visualizer/projectm/wiki/Building-libprojectM)
15-
and `sudo make install` [libprojectM](https://github.com/projectM-visualizer/projectm)
14+
First, [build libprojectM](https://github.com/projectM-visualizer/projectm/wiki/Building-libprojectM) or get it via your
15+
favorite dependency management/packaging tool. For testing, you can install libprojectM somewhere inside your
16+
home/development directory using `CMAKE_INSTALL_PREFIX`, then pass the same install path to the frontend-sdl2 build
17+
using `CMAKE_PREFIX_PATH`. Please refer
18+
to [CMake's documentation](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html) for details.
1619

1720
### Dependencies
1821

@@ -29,13 +32,20 @@ Depending on your needs, you can either build them yourself or install them usin
2932
are some examples for the three major desktop platforms:
3033

3134
```shell
32-
sudo apt install libsdl2-dev libpoco-dev cmake # Debian/Ubuntu Linux
33-
brew install sdl2 # macOS
34-
vcpkg install sdl2 poco # Windows
35+
sudo apt install libsdl2-dev libpoco-dev libfreetype-dev cmake # Debian/Ubuntu Linux
36+
brew install sdl2 poco freetype # macOS
37+
vcpkg install sdl2 poco freetype # Windows, should be pulled in automatically via vcpkg.json
3538
```
3639

3740
### Configure and build projectMSDL
3841

42+
After cloning or updating the Git repository, always remember to update or initialize the submodules as well. this is
43+
not required when building from a release tarball or ZIP.
44+
45+
```shell
46+
git submodule --init update
47+
```
48+
3949
If all dependencies are in the CMake and/or the system search directories, you can configure and build the application
4050
with these commands, executed from the source dir:
4151

@@ -45,15 +55,17 @@ cmake -S . -B cmake-build -DCMAKE_BUILD_TYPE=Release
4555
cmake --build cmake-build --config Release
4656
```
4757

48-
You can optionally add the `--parallel` argument to the build command to speed up the build.
58+
You can optionally add the `--parallel` argument with the number of CPU cores to use to the build command to speed up
59+
the build.
4960

5061
If your dependencies are in different locations than the default search paths, or you're cross-compiling, you'll need to
51-
add more options. Covering all CMake options is out of the scope of this document. Please read
62+
add more options like `CMAKE_PREFIX_PATH`. Covering all CMake options is out of the scope of this document. Please read
5263
the [Mastering CMake guide](https://cmake.org/cmake/help/book/mastering-cmake/index.html) and
5364
the [CMake documentation](https://cmake.org/cmake/help/latest/) for more information.
5465

55-
This will use CMake's default build file generator for your current platform and build the project in Release (
56-
optimized) configuration. If the build was successful, you should have an executable in the build directory.
66+
The above command will use CMake's default build file generator for your current platform and build the project in
67+
Release (optimized) configuration. If the build was successful, you should have an executable in the build directory. On
68+
Windows, you may need to specify the correct Visual Studio generator and architecture manually.
5769

5870
### Install projectMSDL
5971

@@ -82,8 +94,8 @@ can also create a user configuration file in your user's home directory. Dependi
8294

8395
- Windows: `%APPDATA%\projectM\projectMSDL.properties`
8496
- Linux:
85-
- If `XDG_CONFIG_HOME` env var is non-empty: `$XDG_CONFIG_HOME/projectM/projectMSDL.properties`
86-
- Otherwise: `~/.config/projectM/projectMSDL.properties`
97+
- If `XDG_CONFIG_HOME` env var is non-empty: `$XDG_CONFIG_HOME/projectM/projectMSDL.properties`
98+
- Otherwise: `~/.config/projectM/projectMSDL.properties`
8799
- macOS: `~/Library/Preferences/projectM/projectMSDL.properties`
88100

89101
You can copy the [config file template](src/resources/projectMSDL.properties.in) there and change anything in `@@`.
@@ -99,23 +111,24 @@ cmake-build/src/projectMSDL --presetPath /path/to/presets-cream-of-the-crop --te
99111

100112
Press ESC to toggle the UI.
101113

102-
## Developing
114+
## System-Specific CMake Examples
103115

104-
This project uses CMake, which can generate project files for your favorite IDE or build system
116+
The following examples show how to configure and build projectMSDL with CMake on the different supported platforms.
105117

106118
### Windows
107119

108-
To generate a Visual Studio 2022 project for Win64 and build for Release:
120+
To generate a Visual Studio 2022 project for Win64 and build for Release, with then option to also compile a Debug build
121+
from within the generated solution:
109122

110123
```shell
111124
mkdir cmake-build
112-
cmake -G "Visual Studio 17 2022" -A x64 -S . -B cmake-build
125+
cmake -G "Visual Studio 17 2022" -A x64 -S . -B cmake-build -DCMAKE_CONFIGURATION_TYPES=Debug,Release
113126
cmake --build cmake-build --config Release
114127
```
115128

116129
### Linux
117130

118-
To generate a Makefile project build for Release:
131+
To generate a UNIX Makefile project build for Release:
119132

120133
```shell
121134
mkdir cmake-build
@@ -137,6 +150,6 @@ To generate an Xcode project and build for Release:
137150

138151
```shell
139152
mkdir cmake-build
140-
cmake -G Xcode -S . -B cmake-build
153+
cmake -G Xcode -S . -B cmake-build -DCMAKE_CONFIGURATION_TYPES=Debug,Release
141154
cmake --build cmake-build --config Release
142155
```

0 commit comments

Comments
 (0)