auval seems to be picky about the shell in which it is run. For me, it normally finds all custom AUs from the built-in Terminal app, but only finds Apple’s AUs when running from iTerm/tmux. Perhaps the environment that CMake uses to run the auval command suffers from the same issue.
Also note that the commands aren’t necessarily run in the same shell, so if you cd in one COMMAND, the following commands aren’t guaranteed to use the new directory as the working directory.
Edit: I found the (simple) solution. For anyone who finds this in the future (probably including me), I was missing the DEPENDS command…
Also, as mentioned by @eyalamir, the ‘$’, are needed. However, they were stripped out when I posted. To get them to show on the forum, you need to escape them using ‘\’.
Code in forum posts should be marked as such in order to avoid that (and preserve whitespaces).
It is done by putting three backticks ``` before and after your code snippet, or by adding four spaces before every line, or by selecting the code portion and clicking the “</>” button while editing the post