Ejemplo n.º 1
0
        private void AddPropertyGroup()
        {
            string SInclude = "";
            {
                List <string> LInclude = new List <string>();
                GenerateProjectFile.GetInclude(Name, ref LInclude);// Project.Include.ToList();
                foreach (var ia in LInclude)
                {
                    SInclude += ia + ";";
                }
            }

            string command = "";

            if (!Config.Global.UNICODE)
            {
                command += "-ansi ";
            }
            if (Config.Global.WithoutWarning)
            {
                command += "-withoutwarning ";
            }


            for (int i = 0; i < Platfroms.Length; i++)
            {
                string p = Platfroms[i];

                for (int a = 0; a < Configurations.Length; a++)
                {
                    string c       = Configurations[a];
                    string defines = "WINDOWS;LIB;_LIB";
                    defines += PlatfromsDefines[i];
                    defines += ConfigurationsDefines[a];
                    List <string> LDefines = GenerateProjectFile.MapProjects[GetRealPlatformAndConfiguration(p, c)][ConfigurationsType[a]][Name].Defines.ToList();
                    if (Config.Global.UNICODE)
                    {
                        defines += "_UNICODE;";
                        defines += "UNICODE;";
                    }
                    foreach (var ia in LDefines)
                    {
                        defines += ia + ";";
                    }
                    Vcxproj.PropertyGroup propertyGroup = new Vcxproj.PropertyGroup();
                    propertyGroup.Label = Vcxproj.PropertyGroup.ELabel.EL_Default;
                    propertyGroup.Default.Configuration = c;
                    if (p == "Win64")
                    {
                        propertyGroup.Default.Platform = "x64";
                    }
                    else
                    {
                        propertyGroup.Default.Platform = p;
                    }
                    GetRealPlatformAndConfiguration(ref p, ref c);
                    propertyGroup.Default.OutDir = String.Format("..\\..\\..\\binaries\\{0}\\", p);
                    propertyGroup.Default.IntDir = "..\\..\\..\\binaries\\net\\";
                    propertyGroup.Default.NMakePreprocessorDefinitions = defines;
                    propertyGroup.Default.NMakeIncludeSearchPath       = SInclude;
                    propertyGroup.Default.NMakeOutput             = String.Format("..\\..\\..\\binaries\\{0}\\{1}_{2}.exe", p, GeneralName, c.ToLower());
                    propertyGroup.Default.NMakeBuildCommandLine   = String.Format("{4} {3} {0} {2} {1}", GeneralName, p, c, command, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, AppDomain.CurrentDomain.FriendlyName));
                    propertyGroup.Default.NMakeReBuildCommandLine = String.Format("{4} {3} -rebuild {0} {2} {1}", GeneralName, p, c, command, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, AppDomain.CurrentDomain.FriendlyName));
                    propertyGroup.Default.NMakeCleanCommandLine   = String.Format("{4} {3} -clean {0} {2} {1}", GeneralName, p, c, command, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, AppDomain.CurrentDomain.FriendlyName));
                    XmlVcxproj.propertyGroups.Add(propertyGroup);
                }
            }
        }
Ejemplo n.º 2
0
        void InitVcxproj()
        {
            {
                Vcxproj.ImportGroup importGroup = new Vcxproj.ImportGroup();
                importGroup.Label = Vcxproj.ImportGroup.ELabel.EL_ExtensionSettings;
                XmlVcxproj.importGroups.Add(importGroup);
            }
            {
                Vcxproj.ImportGroup importGroup = new Vcxproj.ImportGroup();
                importGroup.Label = Vcxproj.ImportGroup.ELabel.EL_Shared;
                XmlVcxproj.importGroups.Add(importGroup);
            }
            {
                foreach (string p in Platfroms)
                {
                    foreach (string c in Configurations)
                    {
                        Vcxproj.ImportGroup importGroup = new Vcxproj.ImportGroup();
                        importGroup.Label = Vcxproj.ImportGroup.ELabel.EL_PropertySheets;
                        if (p == "Win64")
                        {
                            importGroup.Platform = "x64";
                        }
                        else
                        {
                            importGroup.Platform = p;
                        }
                        importGroup.Configuration = c;
                        XmlVcxproj.importGroups.Add(importGroup);
                    }
                }
            }
            {
                Vcxproj.ImportGroup importGroup = new Vcxproj.ImportGroup();
                importGroup.Label = Vcxproj.ImportGroup.ELabel.EL_ExtensionTargets;
                XmlVcxproj.importGroups.Add(importGroup);
            }
            {
                Vcxproj.PropertyGroup propertyGroup = new Vcxproj.PropertyGroup();
                propertyGroup.Label = Vcxproj.PropertyGroup.ELabel.EL_Globals;
                propertyGroup.Globals.ProjectGuid   = Guid;
                propertyGroup.Globals.RootNamespace = GeneralName;
                XmlVcxproj.propertyGroups.Add(propertyGroup);
            }
            {
                foreach (string p in Platfroms)
                {
                    foreach (string c in Configurations)
                    {
                        Vcxproj.PropertyGroup propertyGroup = new Vcxproj.PropertyGroup();
                        propertyGroup.Label = Vcxproj.PropertyGroup.ELabel.EL_Configuration;
                        propertyGroup.Configuration.Configuration = c;
                        if (p == "Win64")
                        {
                            propertyGroup.Configuration.Platform = "x64";
                        }
                        else
                        {
                            propertyGroup.Configuration.Platform = p;
                        }

                        XmlVcxproj.propertyGroups.Add(propertyGroup);
                    }
                }
            }
            {
                Vcxproj.ItemGroup itemGroup = new Vcxproj.ItemGroup();
                foreach (string p in Platfroms)
                {
                    foreach (string c in Configurations)
                    {
                        Vcxproj.ProjectConfiguration projectConfiguration = new Vcxproj.ProjectConfiguration();
                        projectConfiguration.Configuration = c;
                        if (p == "Win64")
                        {
                            projectConfiguration.Platform = "x64";
                        }
                        else
                        {
                            projectConfiguration.Platform = p;
                        }
                        itemGroup.projectConfigurations.Add(projectConfiguration);
                    }
                }
                XmlVcxproj.itemGroups.Add(itemGroup);
            }
        }