11# Building projectM from source
22
3- Suggested: use CMake. See [ BUILDING-cmake.md ] ( ./BUILDING-cmake.md ) .
3+ Since version 4.0, projectM uses CMake to configure and build the library on all platforms .
44
5- This document describes the deprecated GNU Autotools setup.
5+ This file only contains quick-start build instructions. For a more detailed guide and a list of all build options,
6+ please read the [ BUILDING-cmake.md] ( BUILDING-cmake.md ) file.
67
78## Quick Start (Debian / Ubuntu)
89
@@ -13,23 +14,26 @@ For other operating systems (Windows/macOS), see the OS-specific sections below.
1314Mandatory packages:
1415
1516``` bash
16- sudo apt install build-essential libgl1-mesa-dev mesa-common-dev libsdl2-dev libglm -dev
17+ sudo apt install build-essential cmake libgl1-mesa-dev mesa-common-dev
1718```
1819
19- Optional packages for additional features:
20+ ** Important:** Depending on your distribution, the CMake package might be too old to build projectM, e.g. Debian 11 (
21+ bookworm) only provides CMake 3.18 while CMake 3.21 is required. In this case, get the latest CMake
22+ release [ from Kitware's download page] ( https://cmake.org/download/ ) .
23+
24+ Optional packages:
2025
2126``` bash
22- sudo apt install qtbase5-dev # For building Qt-based UIs
23- sudo apt install libvisual-0.4-dev # To build the libvisual plug-in
24- sudo apt install libjack-jackd2-dev # To build the JACK visualizer application
2527sudo apt install ninja-build # To build projectM with Ninja instead of make
28+ sudo apt install libsdl2-dev # To build the development test UI
2629```
2730
2831### Download the projectM sources
2932
30- If you want to use a stable version of projectM, download the latest release from
31- the [ Releases page on GitHub] ( https://github.com/projectM-visualizer/projectm/releases ) and unpack it. You can then skip
32- to the next step.
33+ For production use, it is highly recommended to use the latest stable version of projectM. Download the latest release
34+ from the [ Releases page on GitHub] ( https://github.com/projectM-visualizer/projectm/releases ) and unpack it.
35+
36+ #### Using a development version
3337
3438If you prefer a bleeding-edge version or want to modify the code, clone the Git repository and initialize any
3539submodules:
@@ -83,31 +87,21 @@ development files. To build projectM, both binaries and development files need t
8387
8488#### General build dependencies for all platforms:
8589
86- * A working build toolchain.
90+ * A working build toolchain (compiler, linker).
91+ * CMake 3.21 or highter.
8792* ** OpenGL** : 3D graphics library. Used to render the visualizations.
8893* ** GLES3** : OpenGL libraries for embedded systems, version 3. Required to build projectM on mobile devices, Raspberry
8994 Pi and Emscripten.
90- * [ ** glm** ] ( https://github.com/g-truc/glm ) : OpenGL Mathematics library. Optional, will use a bundled version with
91- autotools or if not installed.
95+ * [ ** glm** ] ( https://github.com/g-truc/glm ) : OpenGL Mathematics library. It is optional, projectM will use a bundled
96+ version if not installed.
9297* [ ** SDL2** ] ( https://github.com/libsdl-org/SDL ) : Simple Directmedia Layer. Version 2.0.5 or higher is required to build
93- the standalone visualizer application (projectMSDL).
94-
95- #### Only relevant for Linux distributions, FreeBSD and macOS:
96-
97- * [ ** Qt5** ] ( https://www.qt.io/ ) : Qt cross-platform UI framework. Used to build the Pulseaudio and JACK visualizer
98- applications. Requires the ` Gui ` and ` OpenGL ` component libraries/frameworks.
99- * [ ** Pulseaudio** ] ( https://www.freedesktop.org/wiki/Software/PulseAudio/ ) : Sound system for POSIX platforms. Required to
100- build the Pulseaudio visualizer application.
101- * [ ** JACK** ] ( https://jackaudio.org/ ) : Real-time audio server. Required to build the JACK visualizer application.
102- * [ ** libvisual 0.4** ] ( http://libvisual.org/ ) : Audio visualization library with plug-in support. Required to build the
103- projectM libvisual plug-in.
104- * [ ** CMake** ] ( https://cmake.org/ ) : Used to generate platform-specific build files.
98+ the development test application in the build directory.
99+ * [ ** vcpkg** ] ( https://github.com/microsoft/vcpkg ) : C++ Dependency Manager. Optional, but recommended to install
100+ library dependencies and/or using CMake to configure the build. Mainly used on Windows, but also works for Linux and
101+ macOS.
105102
106103### Only relevant for Windows:
107104
108- * [ ** vcpkg** ] ( https://github.com/microsoft/vcpkg ) : C++ Library Manager for Windows. Optional, but recommended to install
109- the aforementioned library dependencies and/or using CMake to configure the build.
110- * [ ** NuGet** ] ( https://www.nuget.org/ ) : Dependency manager for .NET. Required to build the EyeTune app.
111105* [ ** GLEW** ] ( http://glew.sourceforge.net/ ) : The OpenGL Extension Wrangler Library. Only required if using CMake to
112106 configure the build, the pre-created solutions use a bundled copy of GLEW.
113107
@@ -119,37 +113,26 @@ development files. To build projectM, both binaries and development files need t
119113 commands to install them vary widely between distributions (and even versions of the same distribution). Please refer
120114 to the documentation of your build OS on how to find and install the required libraries.
121115- On * BSD, install the appropriate Ports with ` pkg install ` .
122- - On macOS, using [ Homebrew] ( https://brew.sh/ ) is the recommended way of installing any dependencies not supplied by
123- Xcode.
124-
125- ### Building with CMake
126-
127- ---
116+ - On macOS, a working Xcode installation is required. CMake (and libSDL2 for the test UI) can be installed
117+ using [ Homebrew] ( https://brew.sh/ ) .
128118
129- :exclamation : ** IMPORTANT NOTE** : Currently, CMake build support is still in active development and considered
130- unfinished. It is working and produces running binaries, but there are still some features, build internals and whole
131- targets missing. While testing the CMake build files on any platform and feedback on this is strongly encouraged,
132- CMake-based builds should not yet be used in any production environment until this message is gone.
133-
134- ---
119+ ### Building
135120
136121The steps documented below are a bare minimum quickstart guide on how to build and install the project. If you want to
137122configure the build to your needs, require more in-depth information about the build process and available tweaks, or on
138123how to use libprojectM in your own CMake-based projects, see [ BUILDING-cmake.md] ( BUILDING-cmake.md ) .
139124
140- Using CMake is the recommended and future-proof way of building projectM. CMake is a platform-independent tool that is
141- able to generate files for multiple build systems and toolsets while using only a single set of build instructions.
142- CMake support is still new and in development, but will replace the other project files (automake/autoconf scripts,
143- Visual Studio solutions and Xcode projects) in this repository once mature and stable.
125+ Using CMake is the only supported way of building projectM since version 4.0. CMake is a platform-independent tool that
126+ is able to generate files for multiple build systems and toolsets while using only a single set of build instructions.
144127
145128Building the project with CMake requires two steps:
146129
147130- Configure the build and generate project files.
148131- Build and install the project using the selected build tools.
149132
150- ** Note:** When building with CMake, the build directory should always be separate from the source directory. Generating
151- the build files directly inside the source tree is possible, but strongly discouraged. Using a subdirectory,
152- e.g. ` cmake-build ` inside the source directory is fine though.
133+ ** Note:** The build directory should always be different from the source directory. Generating the build files directly
134+ inside the source tree is possible, but strongly discouraged. Using a subdirectory, e.g. ` cmake-build ` inside the source
135+ directory is fine though.
153136
154137This documentation only covers project-specific information. CMake is way too versatile and feature-rich to cover any
155138possible platform- and toolset-specific configuration details here. If you are not experienced in using CMake, please
@@ -190,13 +173,18 @@ cmake --build /path/to/build/dir --config Release
190173sudo cmake --build /path/to/build/dir --config Release --target install
191174```
192175
193- If you don't need root permissions to install running the second command without ` sudo ` is sufficient.
176+ If you don't need root permissions to install to the given path, running the second command without ` sudo ` is
177+ sufficient.
178+
179+ To control how many files are compiled in parallel, pass the ` --parallel N ` argument to the build command, with ` N `
180+ being the number of concurrent compile commands. If not given explicitly, the build processor (make, ninja, MSBuild,
181+ xcodebuild etc.) will decide the limit, which may range from one file at a time to all files at once.
194182
195183If you want to provide arguments directly to the toolset command, add ` -- ` at the end of the CMake command line followed
196184by any additional arguments. CMake will pass these * unchanged and unchecked* to the subcommand:
197185
198186``` shell
199- cmake --build /path/to/build/dir --config Release -- -j 4
187+ cmake --build /path/to/build/dir --config Release -- < additional build tool args >
200188```
201189
202190## Building on Windows
@@ -226,10 +214,10 @@ To make CMake aware of the installed vcpkg packages, simply use the provided too
226214projectM build by
227215pointing [ ` CMAKE_TOOLCHAIN_FILE ` ] ( https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html ) to it.
228216
229- Here is a full command line example to create a Visual Studio 2019 solution for X64:
217+ Here is a full command line example to create a Visual Studio 2022 solution for X64:
230218
231219``` commandline
232- cmake -G "Visual Studio 16 2019 " -A "X64" -DCMAKE_TOOLCHAIN_FILE="<path to vcpkg>/scripts/buildsystems/vcpkg.cmake" -S "<path to source dir>" -B "<path to build dir>"
220+ cmake -G "Visual Studio 17 2022 " -A "X64" -DCMAKE_TOOLCHAIN_FILE="<path to vcpkg>/scripts/buildsystems/vcpkg.cmake" -S "<path to source dir>" -B "<path to build dir>"
233221```
234222
235223If you use the CMake GUI, check the "Specify toolchain file for cross-compiling" option in the first page of the
@@ -280,10 +268,43 @@ cmake --build "<path to build dir>" --config Release
280268
281269## Notes on other platforms and features
282270
271+ ### Supported platforms
272+
273+ libprojectM is designed to be compatible with as many platforms and architectures as possible. Thus, the code base
274+ doesn't use any non-portable code like OS-specific APIs or assembly instructions.
275+
276+ The code compiles for the following target architectures:
277+
278+ - i686 (x32 / x86)
279+ - x86_64 (x64)
280+ - armv7 (arm)
281+ - aarch64 (arm64 / armv8)
282+ - WASM
283+
284+ Other architectures such as PPC, RISC and MIPS should be supported as well. Big-endian support is untested and thus
285+ might be buggy.
286+
287+ libprojectM builds at least on the following platforms:
288+
289+ - Windows
290+ - Linux
291+ - macOS (iOS/tvOS as well, but be aware that Apple's TOS may prevent its use in Store apps!)
292+ - BSD derivates
293+ - Android
294+ - WebGL/WASM (using emscripten)
295+
296+ As long as a platform provides OpenGL Core 3.3 or OpenGL ES 3.2 libraries and supports at least C++ 14, libprojectM
297+ should build fine.
298+
283299### Raspberry Pi (and other embedded systems)
284300
285- * projectM is arch-independent, although there are some SSE2 enhancements for x86
286- * [ Notes on running on raspberry pi] ( https://github.com/projectM-visualizer/projectm/issues/115 )
301+ Make sure to enable GLES support by passing ` -DENABLE_GLES=TRUE ` to CMake's configuration command and install the
302+ appropriate OS libraries. Otherwise, follow the Linux build instructions above.
303+
304+ For applications using projectM, it's highly recommended to keep certain performance-related settings low, such as:
305+
306+ - The per-point mesh resolution should be kept low, e.g. 48x32
307+ - The rendering resolution should not exceed 720p on the Pi, though most presets will also run at ~ 60 FPS in 1080p
287308
288309### Build using NDK for Android
289310
@@ -299,22 +320,15 @@ Some UNIX build systems cannot use CMake config packages, like GNU autotools. To
299320systems, projectM's build system also creates basic ` .pc ` files during the installation process.
300321
301322Note that the resulting pkgconfig files will not necessarily work in all circumstances, because they are much less
302- flexible than CMake (or Meson). When using pkgconfig, some required libraries will probably nor be linked
323+ flexible than CMake (or Meson). When using pkgconfig, some required libraries will probably not be linked
303324automatically (e.g. OpenGL libraries) and have to be added manually depending on the application needs.
304325
305- ## libprojectM
306-
307- ` libprojectM ` is the core library. It is made up of three sub-libraries:
308-
309- #### Renderer
310-
311- Made up of everything in ` src/libprojectM/Renderer ` . These files compose the ` libRenderer ` sub-library.
312-
313- ### Assets
326+ ### Frontends and audio capturing
314327
315- ` libprojectM ` can either have a configuration hard-coded or load from a configuration file. It's up to each application
316- to decide how to load the config file. The config file can have paths defined specifying where to load fonts and presets
317- from.
328+ Previous projectM versions (before 4.0) came with several UIs and audio capture implementations. To reduce the size of
329+ the code base and separate the release cycles and development of the core library and the frontends, these have been
330+ removed from libprojectM and either being rewritten or moved into their own, separate Git repository .
318331
319- You will want to install the config file and presets somewhere, and then define that path for the application you're
320- trying to build.
332+ libprojectM on its own does not have any means of capturing audio, it simply takes PCM data via the API. Applications
333+ using projectM can supply this data from their own audio sources, e.g. music playing in an audio player or capturing
334+ audio data from OS or other external sources.
0 commit comments