| | |
| | | string description = "Uic'ing " + ProjectMacros.FileName + "...";
|
| | |
|
| | | foreach (VCFileConfiguration config in (IVCCollection)file.FileConfigurations) {
|
| | |
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | switch (toolSettings) {
|
| | | case CustomTool.MSBuildTarget:
|
| | | AddUic4BuildStepMsBuild(config, description, uiFileMacro);
|
| | |
| | | if (hasDifferentMocFilePerPlatform && hasDifferentMocFilePerConfig) {
|
| | | foreach (VCFileConfiguration mocConf
|
| | | in (IVCCollection)mocFile.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(mocConf))
|
| | | continue;
|
| | | var projectCfg = mocConf.ProjectConfiguration as VCConfiguration;
|
| | | if (projectCfg.Name != vcConfig.Name
|
| | | || (IsMoccedFileIncluded(sourceFile) && !mocableIsCPP)) {
|
| | |
| | | } else if (hasDifferentMocFilePerPlatform) {
|
| | | foreach (VCFileConfiguration mocConf
|
| | | in (IVCCollection)mocFile.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(mocConf))
|
| | | continue;
|
| | | var projectCfg = mocConf.ProjectConfiguration as VCConfiguration;
|
| | | var mocConfPlatform = projectCfg.Platform as VCPlatform;
|
| | | if (projectCfg.ConfigurationName != vcConfig.ConfigurationName)
|
| | |
| | | } else if (hasDifferentMocFilePerConfig) {
|
| | | foreach (VCFileConfiguration mocConf
|
| | | in (IVCCollection)mocFile.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(mocConf))
|
| | | continue;
|
| | | var projectCfg = mocConf.ProjectConfiguration as VCConfiguration;
|
| | | var mocConfPlatform = projectCfg.Platform as VCPlatform;
|
| | | if (platformName != mocConfPlatform.Name)
|
| | |
| | | file.ItemType = QtMoc.ItemTypeName;
|
| | | if (HelperFunctions.IsSourceFile(file.FullPath)) {
|
| | | foreach (VCFileConfiguration config in (IVCCollection)file.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | qtMsBuild.SetItemProperty(config, QtMoc.Property.DynamicSource, "input");
|
| | | qtMsBuild.SetItemPropertyByName(config, "QtMocFileName", "%(Filename).moc");
|
| | | }
|
| | |
| | | HelperFunctions.EnsureCustomBuildToolAvailable(mocFileItem);
|
| | | }
|
| | |
|
| | | foreach (VCFileConfiguration config in (IVCCollection)file.FileConfigurations)
|
| | | foreach (VCFileConfiguration config in (IVCCollection)file.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | AddMocStepToConfiguration(sourceFile, config, toolSettings);
|
| | | }
|
| | |
|
| | | } catch {
|
| | | throw new QtVSException(SR.GetString("QtProject_CannotAddMocStep", file.FullPath));
|
| | |
| | | if (file == null)
|
| | | return false;
|
| | | foreach (VCFileConfiguration config in (IVCCollection)file.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | var tool = HelperFunctions.GetCustomBuildTool(config);
|
| | | if (tool == null)
|
| | | return false;
|
| | |
| | | bool IsCppMocFileQtMsBuild(VCProject vcProj, VCFile vcFile, VCFile cppFile)
|
| | | {
|
| | | foreach (VCFileConfiguration fileConfig in (IVCCollection)vcFile.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(fileConfig))
|
| | | continue;
|
| | | string inputFile = qtMsBuild.GetPropertyValue(fileConfig, QtMoc.Property.InputFile);
|
| | | HelperFunctions.ExpandString(ref inputFile, fileConfig);
|
| | | if (HelperFunctions.PathIsRelativeTo(inputFile, cppFile.ItemName))
|
| | |
| | | }
|
| | | }
|
| | | if (!subfilterFound) {
|
| | | if (!vfilt.CanAddFilter(subfilterName))
|
| | | if (vfilt.CanAddFilter(subfilterName)) {
|
| | | vfilt.AddFilter(subfilterName);
|
| | | foreach (VCFilter subfilt in vfilt.Filters as IVCCollection) {
|
| | | if (subfilt.Name.ToLower() == lowerSubFilterName) {
|
| | | vfilt = subfilt;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | throw new QtVSException($"Project cannot add filter {filter.Name}");
|
| | | }
|
| | | }
|
| | |
| | | /// <param name="file">file</param>
|
| | | public void RemoveFileFromFilter(VCFile file, VCFilter filter)
|
| | | {
|
| | | try {
|
| | | filter.RemoveFile(file);
|
| | | var fi = new FileInfo(file.FullPath);
|
| | | if (fi.Exists)
|
| | | fi.Delete();
|
| | | } catch {
|
| | | }
|
| | |
|
| | | var fileName = file.FullPath;
|
| | |
|
| | | bool isSubFilter = false;
|
| | | VCFilter subFlt = null;
|
| | |
|
| | | var subfilters = (IVCCollection)filter.Filters;
|
| | | for (var i = subfilters.Count; i > 0; i--) {
|
| | | if (isSubFilter)
|
| | | break;
|
| | | try {
|
| | | var subfilter = (VCFilter)subfilters.Item(i);
|
| | | RemoveFileFromFilter(file, subfilter);
|
| | |
|
| | | foreach (VCFile subFile in (IVCCollection)subfilter.Files) {
|
| | | isSubFilter = (subFile.FullPath.Contains(file.Name) && file.FullPath.Contains(subfilter.Name));
|
| | | if (isSubFilter) {
|
| | | subFlt = subfilter;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | } catch {
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | try {
|
| | | if (isSubFilter && subFlt != null) {
|
| | | subFlt.RemoveFile(file);
|
| | | } else {
|
| | | filter.RemoveFile(file);
|
| | | }
|
| | |
|
| | | var fi = new FileInfo(fileName);
|
| | | if (fi.Exists)
|
| | | fi.Delete();
|
| | |
|
| | |
|
| | | } catch {
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void MoveFileToDeletedFolder(VCFile vcfile)
|
| | |
| | | public static void SetPCHOption(VCFile vcFile, pchOption option)
|
| | | {
|
| | | foreach (VCFileConfiguration config in vcFile.FileConfigurations as IVCCollection) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | var compiler = CompilerToolWrapper.Create(config);
|
| | | compiler.SetUsePrecompiledHeader(option);
|
| | | }
|
| | |
| | | private static VCFileConfiguration GetVCFileConfigurationByName(VCFile file, string configName)
|
| | | {
|
| | | foreach (VCFileConfiguration cfg in (IVCCollection)file.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(cfg))
|
| | | continue;
|
| | | if (cfg.Name == configName)
|
| | | return cfg;
|
| | | }
|
| | |
| | | mocCmdChecker = new MocCmdChecker();
|
| | |
|
| | | foreach (VCFileConfiguration config in (IVCCollection)vcfile.FileConfigurations) {
|
| | | if (HelperFunctions.IsConfExcludeFromSolution(config))
|
| | | continue;
|
| | | try {
|
| | | string commandLine = "";
|
| | | VCCustomBuildTool tool = null;
|