Refactor the code that translates environment variables to CMake command line
options to be table-driven, as suggested by Stijn De Weirdt.