I’m looking for a basic automation tool; I don’t know whether it doesn’t exist, or if all of my google searches are still too generic. What I would like to do is start with a template file file.in and generate a target file file.out by running a tool (script?) to replace all occurrences of certain substitution strings with their definitions in a macro file macros.txt. More concretely, the macros file would contain entries like
PATH = /Users/me/mypath/...
And the template file would contain text like
"... change the working directory to @PATH@ and ... "
At the moment I’m accomplishing what I need by using CMake’s configure_file(), but that seems too heavy handed for the task at hand. Ultimately the target files will be XML documents where I need to populate a few fields with configuration-dependent information.
Okay, SO just informed me that this question won me the Tumbleweed badge. I decided to roll my own solution, which amounted to about 10 lines of Python.