I have my machine setup to run cmake and gcc, and I would like to install the cygwin with the exact same set of packages and parameters on the build machine, and possibly on other development machine. Is there a way to do that without having to setup cygwin manually in the GUI, using the Setup.exe as provided?
You can use Cygwin's setup.exe command line options to automate the process.
For an automated installation, the Cygwin website recommends doing a full install and saving off the downloaded package tree, then performing a local install using the following command:
setup.exe -q -L -l {path-to-package-dir}
That's only one possible setup, however; depending on exactly what you want to do, the command line options allow you to download fresh packages from the internet, install specific packages, etc etc.