Наша сборка Qt VS Tools
giy
2022-09-02 ca47896204482bf4a6979e3838bf7f09f61cebeb
QtVsTools.Core/QMake.cs
@@ -32,23 +32,24 @@
using System.IO;
using System.Linq;
using System.Text;
using QtVsTools.VisualStudio;
namespace QtVsTools.Core
{
    using VisualStudio;
    public abstract class QMake
    {
        public Dictionary<string, string> Vars { get; protected set; }
        public string OutputFile { get; protected set; }
        public uint DebugLevel { get; protected set; }
        private uint DebugLevel { get; set; }
        public string TemplatePrefix { get; protected set; }
        public bool Recursive { get; protected set; }
        public string ProFile { get; protected set; }
        public string Query { get; protected set; }
        public bool DisableWarnings { get; set; }
        protected VersionInformation QtVersion { get; private set; }
        protected EnvDTE.DTE Dte { get; private set; }
        protected VersionInformation QtVersion { get; }
        private EnvDTE.DTE Dte { get; }
        public QMake(VersionInformation qtVersion, EnvDTE.DTE dte = null)
        {
@@ -196,14 +197,27 @@
                        exitCode = qmakeProc.ExitCode;
                        InfoExit(qmakeProc);
                    }
                } catch (Exception e) {
                    ErrMsg(string.Format("Exception \"{0}\":\r\n{1}",
                        e.Message,
                        e.StackTrace));
                } catch (Exception exception) {
                    exception.Log();
                }
            }
            return exitCode;
        }
        public static bool Exists(string path)
        {
            var possibleQMakePaths = new[] {
                // Path points to qmake.exe
                path,
                // Path points to folder containing qmake.exe
                Path.Combine(path, "qmake.exe"),
                // Path points to folder containing bin\qmake.exe
                Path.Combine(path, "bin", "qmake.exe"),
            };
            return possibleQMakePaths.Where(p => File.Exists(p)
                && Path.GetFileName(p).Equals("qmake.exe", StringComparison.OrdinalIgnoreCase))
                .Any();
        }
    }
    public class QMakeImport : QMake