/* $Id$
This file is part of builder
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
-#include <iostream>
+#include <msp/io/print.h>
#include <msp/strings/utils.h>
#include "binarypackage.h"
#include "builder.h"
use_pkgconfig=false;
}
-/**
-Sets the path where the package files were installed. This is only useful if
-the package doesn't use pkg-config.
-*/
-void BinaryPackage::set_path(const Msp::Path &p)
+void BinaryPackage::set_path(const Msp::FS::Path &p)
{
path=builder.get_cwd()/p;
}
BinaryPackage *BinaryPackage::from_pkgconfig(Builder &builder, const string &name)
{
- list<string> argv;
- argv.push_back("pkg-config");
- argv.push_back("--silence-errors");
- argv.push_back("--cflags");
- argv.push_back("--libs");
- argv.push_back(name);
- if(builder.get_verbose()>=4)
- cout<<"Running "<<join(argv.begin(), argv.end())<<'\n';
- string info=run_command(argv);
-
- if(info.empty())
- return 0;
-
+ string info=builder.run_pkgconfig(name, "flags");
BinaryPackage *pkg=new BinaryPackage(builder, name);
pkg->use_pkgconfig=true;