#include <qprocess.h>
#include <qstringlist.h>
/*
-----BEGIN QCMOD-----
name: botan
arg: botan-config=[path],Path to the Botan configure script
-----END QCMOD-----
*/

class qc_botan : public ConfObj
{
public:
    qc_botan(Conf *c) : ConfObj(c) {}
    QString name() const { return "botan"; }
    QString shortname() const { return "Botan"; }
    
    bool exec()
	{
	    QString path = conf->getenv("QC_BOTAN_CONFIG");
	    if(path.isEmpty())
		path = "botan-config";

	    QStringList incs;
	    QString ver, libs, other;
	    if(!conf->findFooConfig(path, &ver, &incs, &libs, &other))
			return false;
	    
	    for(int n = 0; n < incs.count(); ++n) {
		conf->addIncludePath(incs[n]);
	    }
	    if (!libs.isEmpty()) {
		conf->addLib(libs);
	    }
	    if(!other.isEmpty()) {
		conf->addExtra(QString("QMAKE_CFLAGS += %1\n").arg(other));
	    }
	    return true;
	}
};
