I'm a big fan of pre-flow scripts. Search on this forum, but they run automatically before the compile starts, even from the GUI.
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:io_assignments.tcl"
You can just have a conditional in there that chooses which files to add. The syntax would be the same as the file being added in the .qsf. You may want to add a first step that removes all files. That can be wildcarded. I forget the exact syntax, but type:
quartus_sh --qhelp
Then search under the project library. I think it would be something like "remove_all_global_assignments -name VERILOG_FILE *" Just typing from memory, so need to fix.
Note that if you use a pre-flow script, it will run from memory and from command line:
quartus_sh --flow compile <project_name>
But if your script is of the type:
quartus_map
quarts_fit
etc.
Then you need to add a first line:
quartus_sh -t preflow_script.tcl
Finally, you want to do:
project_open <project_name>
<contents to do what you want>
export_assignments
project_close
(Sorry this is a little disorganized, but I think you get the gist.) These scripts can be really powerful, and I don't think Altera has enough examples. Heck, you could use Tk to bring up a GUI asking which build you're targeting, or something like that.
The only danger is that pre-flow scripts and GUIs don't always place nice. Someone might add a verilog file manually to the project, but if your pre-flow script removes them all, they'll wonder why it keeps disappearing when they compile. It's stuff like that you need to be careful of.