Exemple #1
0
        private void IntegrateIntoConfiguration(VCConfiguration configuration)
        {
            string absPropFilePath      = GetPropsFilePath(configuration);
            string relativePropFilePath = ConanPathHelper.GetRelativePath(configuration.project.ProjectDirectory, absPropFilePath);

            IVCCollection tools = (IVCCollection)configuration.Tools;

            if (tools != null)
            {
                VCLinkerTool ltool = (VCLinkerTool)tools.Item("VCLinkerTool");
                if (ltool != null)
                {
                    string deps = ltool.AdditionalDependencies;
                    ltool.AdditionalDependencies = deps.Replace("$(NOINHERIT)", "");
                }
            }

            foreach (VCPropertySheet sheet in configuration.PropertySheets)
            {
                if (ConanPathHelper.NormalizePath(sheet.PropertySheetFile) == ConanPathHelper.NormalizePath(absPropFilePath))
                {
                    return;
                }
            }
            configuration.AddPropertySheet(relativePropFilePath);
            configuration.CollectIntelliSenseInfo();
        }
Exemple #2
0
        private void IntegrateIntoConfiguration(IVCConfiguration configuration)
        {
            string absPropFilePath      = GetPropsFilePath(configuration);
            string relativePropFilePath = ConanPathHelper.GetRelativePath(configuration.ProjectDirectory, absPropFilePath);

            configuration.AdditionalDependencies = configuration.AdditionalDependencies.Replace("$(NOINHERIT)", "");

            foreach (IVCPropertySheet sheet in configuration.PropertySheets)
            {
                if (ConanPathHelper.NormalizePath(sheet.PropertySheetFile) == ConanPathHelper.NormalizePath(absPropFilePath))
                {
                    string msg = $"[Conan.VisualStudio] Property sheet '{absPropFilePath}' already added to project {configuration.ProjectName}";
                    Logger.Log(msg);
                    return;
                }
            }
            configuration.AddPropertySheet(relativePropFilePath);
            Logger.Log($"[Conan.VisualStudio] Property sheet '{absPropFilePath}' added to project {configuration.ProjectName}");
            configuration.CollectIntelliSenseInfo();
        }