I like the python direction, and possibly making this standalone that generates a CMakeLists.txt file that then automatically runs cmake to configure the project. It would be interesting if at the end of the script cmake.main() can be added so that the script can be invoked itself directly without a new command line tool.