this can be made more extensible / maintainable as follows (untested, needs some gaps filled in)
```python
macros = ['INSTALL_PREFIX=%s'% self.installdir ]
env_macro_map = {
    'CC' : 'C_COMPILER',
    ....
}
for env_name, macro in env_macro_map.items():
    value = os.getenv(env_name)
    if value is not None:
        macros.append("%s='%s'"%(macro,value))
macro_string=" ".join(["-DCMAKE_%s"%x for x in macros])
```
and replace options with macro_string (try to avaoid string concat as much as possible)