from conans.model import Generator

class SConsGenerator(Generator):
    @property
    def filename(self):
        return "SConscript_conan"

    @property
    def content(self):
        template = ('    "{dep}" : {{\n'
                    '        "CPPPATH"     : {info.include_paths},\n'
                    '        "LIBPATH"     : {info.lib_paths},\n'
                    '        "BINPATH"     : {info.bin_paths},\n'
                    '        "LIBS"        : {info.libs},\n'
                    '        "CPPDEFINES"  : {info.defines},\n'
                    '        "CXXFLAGS"    : {info.cppflags},\n'
                    '        "CCFLAGS"     : {info.cflags},\n'
                    '        "SHLINKFLAGS" : {info.sharedlinkflags},\n'
                    '        "LINKFLAGS"   : {info.exelinkflags},\n'
                    '    }},\n')

        sections = []
        sections.append("conan = {\n")

        all_flags = template.format(dep="conan", info=self.deps_build_info)
        sections.append(all_flags)

        for dep_name, info in self.deps_build_info.dependencies:
            dep_name = dep_name.replace("-", "_")
            dep_flags = template.format(dep=dep_name, info=info)
            sections.append(dep_flags)

        sections.append("}\n")

        sections.append("Return('conan')\n")

        return "\n".join(sections)

@@ -1009,32 +1009,220 @@
 end(all_flags)%0A%0A
+        for config, cpp_info in self.deps_build_info.configs.items():%0A            all_flags = template.format(dep=%22conan:%22 + config, info=cpp_info)%0A            sections.append(all_flags)%0A%0A
         for dep_
@@ -1417,32 +1417,222 @@
 end(dep_flags)%0A%0A
+            for config, cpp_info in info.configs.items():%0A                all_flags = template.format(dep=dep_name + %22:%22 + config, info=cpp_info)%0A                sections.append(all_flags)%0A%0A
         sections

Support multi-config variables for the scons generator (#1349)