Fixed bug in generate scripts that prevented additional arguments for CMake.
Improved dependency CMakeLists.txt files.

Ensured that creation of the "input" directory is the last thing, so that the downloaded archive file is guaranteed to be deleted.
Made general improvements to root CMakeLists.txt file.

Made naming consistent, factored out some hard-coding, improved comments, and reordered/grouped commands for readability.