libboost.qcm 1.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
-----BEGIN QCMOD-----
name: libboost
arg: with-libboost-inc=[path], Path to libboost include files
-----END QCMOD-----
*/
class qc_libboost : public ConfObj
{
public:
	qc_libboost(Conf *c) : ConfObj(c) {}
	QString name() const { return "libboost"; }
	QString shortname() const { return "libboost"; }
	bool exec(){
        	QString s;
		s = conf->getenv("QC_WITH_LIBBOOST_INC");
		if(!s.isEmpty()) {
			if(!conf->checkHeader(s, "boost/format.hpp")) {
				return false;
      			}
			if(!conf->checkHeader(s, "boost/date_time/posix_time/posix_time.hpp")) {
				return false;
      			}
			if(!conf->checkHeader(s, "boost/filesystem/path.hpp")) {
				return false;
      			}
			if(!conf->checkHeader(s, "boost/thread.hpp")) {
				return false;
      			}
		}else{
			QStringList sl;
			sl << "/usr/include";
			sl << "/usr/local/include";
			bool found = false;
			foreach(s, sl){
				if(conf->checkHeader(s, "boost/format.hpp")){
					found = true;
					break;
				}
			}
			if(!found) {
				return false;
          		}
			if(!conf->checkHeader(s, "boost/date_time/posix_time/posix_time.hpp")) {
				return false;
      			}
			if(!conf->checkHeader(s, "boost/filesystem/path.hpp")) {
				return false;
      			}
			if(!conf->checkHeader(s, "boost/thread.hpp")) {
				return false;
      			}
		}
		conf->addIncludePath(s);
		return true;
	}
};