Beispiel #1
0
        private QtModuleInfo InitQtModule(QtModule moduleId, string libraryPrefix, string[] defines)
        {
            QtModuleInfo moduleInfo = new QtModuleInfo(moduleId);

            moduleInfo.LibraryPrefix = libraryPrefix;
            moduleInfo.IncludePath   = "$(QTDIR)\\include\\" + libraryPrefix;
            moduleInfo.Defines       = new List <string>();
            dictModulesByDLL.Add(libraryPrefix, moduleId);
            foreach (string str in defines)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }
                moduleInfo.Defines.Add(str);
            }
            dictModuleInfos.Add(moduleId, moduleInfo);

            if (libraryPrefix.StartsWith("Qt"))
            {
                moduleInfo.proVarQT = libraryPrefix.Substring(2).ToLower();
            }
            else
            {
                moduleInfo.proVarQT = libraryPrefix.ToLower();
            }

            return(moduleInfo);
        }
Beispiel #2
0
        private void RemoveDeploySettings(DeploymentToolWrapper deploymentTool, QtModule module,
                                       VCConfiguration config, QtModuleInfo moduleInfo)
        {
            if (moduleInfo == null)
                moduleInfo = QtModules.Instance.ModuleInformation(module);
            if (deploymentTool == null)
                deploymentTool = DeploymentToolWrapper.Create(config);
            if (deploymentTool == null)
                return;

            string destDir = deploymentTool.RemoteDirectory;
            const string qtSrcDir = "$(QTDIR)\\lib";
            string filename = moduleInfo.GetDllFileName(IsDebugConfiguration(config));

            if (deploymentTool.GetAdditionalFiles().IndexOf(filename) >= 0)
                deploymentTool.Remove(filename, qtSrcDir, destDir);

            // remove dependent modules
            foreach (QtModule dependentModule in moduleInfo.dependentModules)
            {
                if (!HasModule(dependentModule))
                    RemoveDeploySettings(deploymentTool, dependentModule, config, null);
            }
        }
Beispiel #3
0
        private void AddDeploySettings(DeploymentToolWrapper deploymentTool, QtModule module,
                                       VCConfiguration config, QtModuleInfo moduleInfo,
                                       VersionInformation versionInfo)
        {
            // for static Qt builds it doesn't make sense
            // to add deployment settings for Qt modules
            if (versionInfo.IsStaticBuild())
                return;

            if (moduleInfo == null)
                moduleInfo = QtModules.Instance.ModuleInformation(module);

            if (moduleInfo == null || !moduleInfo.HasDLL)
                return;

            if (deploymentTool == null)
                deploymentTool = DeploymentToolWrapper.Create(config);
            if (deploymentTool == null)
                return;

            string destDir = deploymentTool.RemoteDirectory;
            const string qtSrcDir = "$(QTDIR)\\lib";
            string filename = moduleInfo.GetDllFileName(IsDebugConfiguration(config));

            if (deploymentTool.GetAdditionalFiles().IndexOf(filename) < 0)
                deploymentTool.Add(filename, qtSrcDir, destDir);

            // add dependent modules
            foreach (QtModule dependentModule in moduleInfo.dependentModules)
                AddDeploySettings(deploymentTool, dependentModule, config, null, versionInfo);
        }
Beispiel #4
0
        private QtModules()
        {
            InitQtModule(QtModule.Core, "QtCore", "QT_CORE_LIB");
            InitQtModule(QtModule.Gui, "QtGui", "QT_GUI_LIB");
            InitQtModule(QtModule.Multimedia, "QtMultimedia", "QT_MULTIMEDIA_LIB");
            InitQtModule(QtModule.Sql, "QtSql", "QT_SQL_LIB");
            InitQtModule(QtModule.Network, "QtNetwork", "QT_NETWORK_LIB");
            InitQtModule(QtModule.Xml, "QtXml", "QT_XML_LIB");
            InitQtModule(QtModule.Script, "QtScript", "QT_SCRIPT_LIB");
            InitQtModule(QtModule.XmlPatterns, "QtXmlPatterns", "QT_XMLPATTERNS_LIB");
            InitQtModule(QtModule.ScriptTools, "QtScriptTools", "QT_SCRIPTTOOLS_LIB");
            InitQtModule(QtModule.Designer, "QtDesigner", "QDESIGNER_EXPORT_WIDGETS");

            QtModuleInfo moduleInfo = null;

            moduleInfo             = InitQtModule(QtModule.Main, "qtmain", "");
            moduleInfo.proVarQT    = null;
            moduleInfo.HasDLL      = false;
            moduleInfo.IncludePath = null;

            moduleInfo              = InitQtModule(QtModule.Test, "QtTest", "");
            moduleInfo.proVarQT     = null;
            moduleInfo.proVarCONFIG = "qtestlib";

            moduleInfo              = InitQtModule(QtModule.Help, "QtHelp", "");
            moduleInfo.proVarQT     = null;
            moduleInfo.proVarCONFIG = "help";

            moduleInfo = InitQtModule(QtModule.Compat, "Qt3Support", new string[] { "QT_QT3SUPPORT_LIB", "QT3_SUPPORT" });
            moduleInfo.AdditionalLibraries.Add("comdlg32.lib");

            moduleInfo = InitQtModule(QtModule.Phonon, "phonon", "QT_PHONON_LIB");

            moduleInfo = InitQtModule(QtModule.WebKit, "QtWebKit", "QT_WEBKIT_LIB");
            moduleInfo.dependentModules.Add(QtModule.Phonon);

            moduleInfo = InitQtModule(QtModule.Svg, "QtSvg", "QT_SVG_LIB");
            moduleInfo.dependentModules.Add(QtModule.Xml);

            moduleInfo = InitQtModule(QtModule.Declarative, "QtDeclarative", "QT_DECLARATIVE_LIB");
            moduleInfo.dependentModules.Add(QtModule.Script);
            moduleInfo.dependentModules.Add(QtModule.Sql);
            moduleInfo.dependentModules.Add(QtModule.XmlPatterns);
            moduleInfo.dependentModules.Add(QtModule.Network);

            moduleInfo = InitQtModule(QtModule.OpenGL, "QtOpenGL", "QT_OPENGL_LIB");
            moduleInfo.AdditionalLibraries.Add("opengl32.lib");
            moduleInfo.AdditionalLibraries.Add("glu32.lib");
            moduleInfo.AdditionalLibrariesWinCE.Add("libgles_cm.lib");

            moduleInfo             = InitQtModule(QtModule.ActiveQtS, "QAxServer", "QAXSERVER");
            moduleInfo.HasDLL      = false;
            moduleInfo.IncludePath = "$(QTDIR)\\include\\ActiveQt";

            moduleInfo             = InitQtModule(QtModule.ActiveQtC, "QAxContainer", "");
            moduleInfo.HasDLL      = false;
            moduleInfo.IncludePath = "$(QTDIR)\\include\\ActiveQt";

            moduleInfo = InitQtModule(QtModule.UiTools, "QtUiTools", "");
            moduleInfo.dependentModules.Add(QtModule.Xml);
            moduleInfo.HasDLL = false;
        }
Beispiel #5
0
        private QtModuleInfo InitQtModule(QtModule moduleId, string libraryPrefix, string[] defines)
        {
            QtModuleInfo moduleInfo = new QtModuleInfo(moduleId);
            moduleInfo.LibraryPrefix = libraryPrefix;
            moduleInfo.IncludePath = "$(QTDIR)\\include\\" + libraryPrefix;
            moduleInfo.Defines = new List<string>();
            dictModulesByDLL.Add(libraryPrefix, moduleId);
            foreach (string str in defines)
            {
                if (string.IsNullOrEmpty(str))
                    continue;
                moduleInfo.Defines.Add(str);
            }
            dictModuleInfos.Add(moduleId, moduleInfo);

            if (libraryPrefix.StartsWith("Qt"))
                moduleInfo.proVarQT = libraryPrefix.Substring(2).ToLower();
            else
                moduleInfo.proVarQT = libraryPrefix.ToLower();

            return moduleInfo;
        }