2009-11-26 04:32:18 +08:00
|
|
|
/*
|
|
|
|
-----BEGIN QCMOD-----
|
|
|
|
name: libnotify
|
|
|
|
-----END QCMOD-----
|
|
|
|
*/
|
|
|
|
// see Conf::findPkgConfig
|
|
|
|
class qc_libnotify : public ConfObj
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
qc_libnotify(Conf *c) : ConfObj(c) {}
|
|
|
|
QString name() const { return "libnotify >= 0.4.2 (optional)"; }
|
|
|
|
QString shortname() const { return "libnotify"; }
|
2010-01-20 07:12:13 +08:00
|
|
|
QString checkString() const {
|
|
|
|
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty())
|
|
|
|
return "";
|
|
|
|
return ConfObj::checkString();
|
|
|
|
}
|
2009-11-26 04:32:18 +08:00
|
|
|
bool exec(){
|
2010-01-20 07:12:13 +08:00
|
|
|
if(!conf->getenv("QC_DISABLE_libnotify").isEmpty() || !conf->getenv("QC_DISABLE_GUI").isEmpty()) {
|
|
|
|
return false;
|
2009-12-15 18:36:18 +08:00
|
|
|
}
|
2009-11-26 04:32:18 +08:00
|
|
|
QStringList incs;
|
|
|
|
QString req_ver = "0.4.2";
|
|
|
|
QString version, libs, other;
|
|
|
|
VersionMode mode = VersionMin;
|
|
|
|
if(conf->findPkgConfig("libnotify", mode, req_ver, &version, &incs, &libs, &other)) {
|
2010-11-21 01:32:59 +08:00
|
|
|
conf->addExtra("CONFIG += libnotify");
|
2009-11-26 04:32:18 +08:00
|
|
|
for(int n = 0; n < incs.count(); ++n)
|
|
|
|
conf->addIncludePath(incs[n]);
|
|
|
|
if(!libs.isEmpty())
|
|
|
|
conf->addLib(libs);
|
|
|
|
QStringList incs2;
|
|
|
|
QString req_ver2 = "2.0";
|
|
|
|
QString version2, libs2, other2;
|
|
|
|
if(conf->findPkgConfig("glib-2.0", mode, req_ver2, &version2, &incs2, &libs2, &other2)) {
|
|
|
|
for(int n = 0; n < incs2.count(); ++n)
|
|
|
|
conf->addIncludePath(incs2[n]);
|
|
|
|
if(!libs2.isEmpty())
|
|
|
|
conf->addLib(libs2);
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-21 01:13:28 +08:00
|
|
|
QStringList incs3;
|
|
|
|
QString req_ver3 = "2.0";
|
|
|
|
QString version3, libs3, other3;
|
|
|
|
if(conf->findPkgConfig("gtk+-2.0", mode, req_ver3, &version3, &incs3, &libs3, &other3)) {
|
|
|
|
for(int n = 0; n < incs3.count(); ++n)
|
|
|
|
conf->addIncludePath(incs3[n]);
|
|
|
|
if(!libs3.isEmpty())
|
|
|
|
conf->addLib(libs3);
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2009-11-26 04:32:18 +08:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2010-07-21 01:13:28 +08:00
|
|
|
|
2009-11-26 04:32:18 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|