Building with CMake
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=C:\Users\hugov\local\ -DCMAKE_PREFIX_PATH=C:\Users\hugov\local\ -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install --config Release
Appending to a TeX macro
% The logic is the following:
% TeX encounters the first \expandafter, the next control sequence is \def, it puts it on the side for now.
% Then, the next token is \expandafter, the next control sequence is \x, it puts it on the side for now. The list of tokens on the side is <\def;\x>
% Then, the next token is \expandafter, the next control sequence is an opening curly brace. This cause the curly brace to be temporarily hidden. So TeX expands the next token and therefore evaluates \x (important: this just performs one expansion level). This and #1 is the content we want to put in \x now. Let's call it \new_x for this demonstration.
% No other tokens, so TeX takes the list of token and can now evaluate \def\x\new_x, which means define \x to be the new value of \x.
% To delve in more into \expandafter, see this tutorial: https://www.tug.org/TUGboat/Articles/tb09-1/tb20bechtolsheim.pdf
% A cool exercice might be to have another parameter to the addx macro which is the macro to which we should append to.
% This is a cool use-case for csname and endcsname. It might require more expandafter though.
\def\addx#1{\expandafter\def\expandafter\x\expandafter{\x #1}}
\def\x{\y}
\def\y{xx}
hello \x
\addx{\y}
\def\y{yy}
hello \x
\addx{c}
hello \x
\bye