Building from Source
AeroLiners Set uses CMake to organize the build: first the .pnml sources are expanded into a single .nml via the C preprocessor, then compiled into the final .grf with nmlc, and finally packaged into .tar release bundles.
Build dependencies
| Tool | Purpose | Get it |
|---|---|---|
| C compiler (GCC/clang/MSVC) | Used only as a C preprocessor to expand #include/#define in .pnml | System / MinGW |
| nmlc | Compiles .nml into .grf (NML compiler) | https://github.com/OpenTTD/nml/releases/latest |
| grfid (grfcodec suite) | Computes the .grf MD5, processes doc templates | https://www.openttd.org/downloads/grfcodec-releases/latest |
| CMake ≥ 3.23 | Build system | System package manager |
| Generator: Ninja / Make / VS | Actually runs the build | Pick one |
Windows users: install MSYS2 + MinGW to get make, gcc, sed, awk, etc. all at once. Other Unix-like systems usually already have them.
Build steps
1. Configure
Use CMake Presets to choose a generator (generated files land in build/<generator>/):
bash
# Ninja
cmake --preset ninja
# or Make
cmake --preset make
# or Visual Studio 2022
cmake --preset vs2. Build
bash
# Ninja (default, non-verbose)
cmake --build build/ninja --preset ninja-default
# Make
cmake --build build/make --preset make-default
# Visual Studio
cmake --build build/vs2022 --preset vs-defaultThe build runs these custom targets in order:
- NML — expand
WAS.pnml(summingsrc/header.pnmletc.) intobin/AeroLinersSet.nmlvia the C preprocessor. - GRF — compile the
.nmlintobin/AeroLinersSet.grfwithnmlc. - Bundles (default
ALL) — package the.grfand docs (readme.txt/license.txt/changelog.txt) into.tar/.tar.bz2/.tar.gz/.tar.xz.
Build artifacts are in the bin/ directory.
3. Clean and rebuild
bash
cmake --build build/ninja --target clean # clean intermediates
# or target a single step
cmake --build build/ninja --target NML
cmake --build build/ninja --target GRFVerbose output
To see the full command lines, use the build preset with the -verbose suffix (sets CMAKE_VERBOSE_MAKEFILE=on and VERBOSE=on):
bash
cmake --build build/ninja --preset ninja-verboseBuild flow
text
WAS.pnml (include aggregation)
│ C preprocessor (gcc -E)
▼
AeroLinersSet.nml
│ nmlc -c
▼
AeroLinersSet.grf
│ grfid -m + doc templates
▼
.tar / .tar.bz2 / .tar.gz / .tar.xz (release bundles)Notes
- Version / revision:
CMakeLists.txtcomputes "days since 2000-01-01" asREPO_REVISIONviastring(TIMESTAMP), writing it intocustom_tags.txtfor the NewGRFversionfield. - Multiplayer compatibility: if you modify the source, the compiled
.grfwill no longer be multiplayer-compatible with the official AeroLiners Set. Differentgrfcodec/nmlcversions also change the GRF checksum and break compatibility. - Do not hand-edit
Makefile/CMakeCache.txt: they are generated by CMake.
Back: Project Structure → | Next: Liveries & Graphics →