Ejemplo n.º 1
0
        static void GenGlobalsProp(XmlOutputGen output, GlobalsPropertyGroup globalsProp)
        {
            output.BeginElem(PROPERTY_GROUP);
            output.AddAttribute(LABEL, "Globals");
            output.AppendSimpleElem(nameof(globalsProp.ProjectGuid), "{6481C558-B7F1-3FA1-BA6E-AD764749B15C}");
            output.AppendSimpleElem(nameof(globalsProp.WindowsTargetPlatformVersion), globalsProp.WindowsTargetPlatformVersion);
            output.AppendSimpleElem(nameof(globalsProp.Keyword), globalsProp.Keyword);
            output.AppendSimpleElem(nameof(globalsProp.Platform), globalsProp.Platform);
            output.AppendSimpleElem(nameof(globalsProp.ProjectName), globalsProp.ProjectName);
            output.AppendSimpleElem(nameof(globalsProp.VCProjectUpgraderObjectName), globalsProp.VCProjectUpgraderObjectName);

            output.EndElem();
        }
Ejemplo n.º 2
0
        internal VcxProject CreateVcxTemplate()
        {
            VcxProject proj = new VcxProject();
            {
                _proj_config = ProjectConfigKind.Debug;

                ConfigSetup();
                ProjectConfiguration projConfig = NewProjectConfig();
                proj.Configurations.Add(projConfig);
            }
            {
                _proj_config = ProjectConfigKind.Release;

                ConfigSetup();
                ProjectConfiguration projConfig = NewProjectConfig();
                proj.Configurations.Add(projConfig);
            }

            GlobalsPropertyGroup globalsProp = proj.GlobalsPropertyGroup;

            globalsProp.ProjectGuid = "{" + Guid.NewGuid() + "}";
            globalsProp.WindowsTargetPlatformVersion = "10.0.18362.0";
            globalsProp.Keyword     = "Win32Proj";
            globalsProp.Platform    = _platform;
            globalsProp.ProjectName = ProjectName; //TODO:
            globalsProp.VCProjectUpgraderObjectName = "NoUpgrade";

            //
            proj.ProjectFileVersion = _projFileVersion;
            proj.CppDefaultProp     = new Import {
                Project = @"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
            };
            proj.CppProp = new Import {
                Project = @"$(VCTargetsPath)\Microsoft.Cpp.props"
            };
            //---------------

            proj.InputItems = _inputs;


            foreach (InputItem item in _inputs)
            {
                //resolve path to abs path
                if (!Path.IsPathRooted(item.Include) ||
                    !File.Exists(item.Include))
                {
                    throw new NotSupportedException();
                }
            }

            proj.PropertySheets = new PropertySheets()
            {
                Import = new Import()
                {
                    Label     = "LocalAppDataPlatform",
                    Project   = @"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props",
                    Condition = @"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')",
                }
            };

            return(proj);
        }