<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setupEnvironment(self, cmd):
 """ Turn all build properties into environment variables """

        shell.ShellCommand.setupEnvironment(self, cmd)
        env = {}
        for k, v in self.build.getProperties().properties.items():
            env[str(k)] = str(v[0])
        if cmd.args['env'] is None:
            cmd.args['env'] = {}
        cmd.args['env'].update(env)