Migrated from Make to CMake.

This commit is contained in:
Johannes Findeisen 2026-11-06 19:05:14 +01:00
commit b6ba093000
52 changed files with 1276 additions and 1210 deletions

View file

@ -1,15 +1,15 @@
# Linux Setup and Installation
Use a C99 compiler, C++17 compiler for the GUI, GNU Make, binutils and
Use a C99 compiler, C++17 compiler for the GUI, CMake 3.25+, a CMake backend, binutils and
pkg-config. The core needs only the C/math runtime. FLTK 1.4 development files
enable the GUI; JACK-compatible development files enable the optional audio/MIDI
backend. Packaging/install tests additionally use Python 3.12+ (standard library
only). No command starts a server, installs dependencies or changes system
backend. Build/test/install tooling uses Python 3.12+ (standard library only). No command starts a server, installs dependencies or changes system
settings.
```sh
make all test
make gui
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build --parallel
ctest --test-dir build --output-on-failure
./build/xtc
```
@ -31,17 +31,20 @@ files.
## Staged Installation
Core-only installation retains the original `make install` behavior and now adds
xtc-check, pkg-config metadata, license and documentation. install-gui adds the
GUI executable and desktop launcher. Defaults to PREFIX=/usr/local:
CMake installation includes the core, xtc-check, pkg-config metadata, licenses
and documentation. `XTC_INSTALL_GUI` defaults on when FLTK was found, adding the
application and desktop launcher. Use `-DXTC_INSTALL_GUI=OFF` for core-only
installation. The prefix defaults to `/usr/local`:
```sh
make install-gui DESTDIR="$PWD/build/stage" PREFIX=/usr
make uninstall DESTDIR="$PWD/build/stage" PREFIX=/usr
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build --parallel
DESTDIR="$PWD/build/stage" cmake --install build
DESTDIR="$PWD/build/stage" cmake --build build --target uninstall
```
Review staged contents before using a package manager or choosing a writable
live prefix. For a user installation, use an absolute PREFIX such as
live prefix. For a user installation, use an absolute `CMAKE_INSTALL_PREFIX` such as
`$HOME/.local` and ensure its bin is in PATH. Prefixes containing spaces are
tested; shell metacharacters/newlines, quotes, dollar signs and backslashes are
not supported. No root installation is performed by tests. Uninstall from the
@ -59,15 +62,16 @@ C/C++ consumers use `pkg-config --cflags --libs --static xtc` plus the chosen
compiler; expose PREFIX/lib/pkgconfig through PKG_CONFIG_PATH when needed.
Static backend consumers need JACK if that optional backend was built; the pc
file records its private dependency. Public headers contain no JACK/FLTK types.
To build without optional libraries, set PKG_CONFIG=false FLTK_CONFIG=false.
To build without optional libraries, configure with `-DXTC_BUILD_GUI=OFF
-DXTC_WITH_JACK=OFF -DXTC_WITH_LADSPA=OFF`.
Python is not needed to run the installed executables or library.
---
## Binary/Development Archive
`make package` creates a system-linked Linux archive plus SHA-256 sidecar below
BUILD_DIR; `make test-package` verifies its contents. It includes usr/bin,
`cmake --build build --target package-binary` creates a system-linked Linux archive plus SHA-256 sidecar below
the selected binary directory; `cmake --build build --target test-package` verifies its contents. It includes usr/bin,
headers/static library/pkg-config metadata, desktop file (when FLTK is present),
manuals, baseline and MIT license. No shared library, third-party plugin, media,
service or dependency installer is bundled. `BINARY_MANIFEST.json` lists file
@ -80,8 +84,8 @@ extract the archive with two leading path components stripped
(`xtc-VERSION-linux- ARCH/usr`), placing bin/include/lib/share directly under
that prefix. Put its bin on PATH and lib/pkgconfig on PKG_CONFIG_PATH. The
archive's pkg-config prefix is relative to its installed location; normal
`make install` retains explicit PREFIX. Use the matching source's uninstall with
that PREFIX, or review the manifest before removing its files. Unknown/unrelated
`cmake --build build --target install` retains its configured prefix. Use the matching source's uninstall with
that prefix, or review the manifest before removing its files. Unknown/unrelated
files are retained by source uninstall. This local tar package is not a
pacman/RPM/deb registration or public distribution.
@ -90,5 +94,5 @@ without opening a server or executing a plugin. `xtc --diagnose` works
headlessly as well. Missing runtime GUI libraries are loader errors: install the
distribution's compatible dependencies or rebuild the core-only configuration.
Build without optional libraries using a fresh directory,
`PKG_CONFIG=false FLTK_CONFIG=false CPPFLAGS=-DXTC_DISABLE_LADSPA`. No system
`cmake -S . -B build/minimal -DXTC_BUILD_GUI=OFF -DXTC_WITH_JACK=OFF -DXTC_WITH_LADSPA=OFF`. No system
setting or package is changed by tests.