Fixed: choose filetransfer transport by priority (thanks Dealer_WeARE)
[iris.git] / qcm / extra.qcm
blobcf86cbacf4c01af94970e0232c38d61a0408f07f
1 /*
2 -----BEGIN QCMOD-----
3 name: extra
4 section: project
5 arg: disable-tests,Don't build examples and unittests.
6 -----END QCMOD-----
7 */
9 class qc_extra : public ConfObj
11 public:
12         qc_extra(Conf *c) : ConfObj(c) {}
13         QString name() const { return "extra"; }
14         QString shortname() const { return "extra"; }
16         // no output
17         QString checkString() const { return QString(); }
19         bool exec()
20         {
21                 QString str;
22                 QFile f;
24                 if(conf->getenv("QC_DISABLE_TESTS") == "Y")
25                         str += "CONFIG += no_tests\n";
27                 conf->addExtra(str);
29                 bool release = true;
30                 bool debug = false;
31                 bool debug_info = false;
32                 bool universal = false;
33                 QString sdk;
35 #ifdef QC_BUILDMODE
36                 release = qc_buildmode_release;
37                 debug = qc_buildmode_debug;
38                 debug_info = qc_buildmode_separate_debug_info;
39 #endif
41 #ifdef QC_UNIVERSAL
42                 universal = qc_universal_enabled;
43                 sdk = qc_universal_sdk;
44 #endif
46                 // write confapp_unix.pri
47                 str = QString();
48                 QString var = conf->getenv("BINDIR");
49                 if(!var.isEmpty())
50                         str += QString("BINDIR = %1\n").arg(var);
51                 if(debug) // debug or debug-and-release
52                         str += QString("CONFIG += debug\n");
53                 else // release
54                         str += QString("CONFIG += release\n");
55                 if(debug_info)
56                 {
57                         str += QString("CONFIG += separate_debug_info\n");
58                         str += "QMAKE_CFLAGS += -g\n";
59                         str += "QMAKE_CXXFLAGS += -g\n";
60                 }
61                 if(universal)
62                 {
63                         str +=
64                         "contains(QT_CONFIG,x86):contains(QT_CONFIG,ppc) {\n"
65                         "       CONFIG += x86 ppc\n"
66                         "}\n";
68                         if(!sdk.isEmpty())
69                                 str += QString("QMAKE_MAC_SDK = %1\n").arg(sdk);
70                 }
71 #ifdef QC_QCA
72                 if(!qc_qca_procode.isEmpty())
73                         str += qc_qca_procode;
74 #endif
75                 f.setFileName("confapp_unix.pri");
76                 if(f.open(QFile::WriteOnly | QFile::Truncate))
77                         f.write(str.toLatin1());
78                 f.close();
80                 return true;
81         }
83         QString makeEscapedDefine(const QString &var, const QString &val)
84         {
85                 QString str = QString(
86                 "DEFINES += %1=\\\\\\\\\\\\\\"%2\\\\\\\\\\\\\\"\n"
87                 ).arg(var).arg(val);
88                 return str;
89         }