]> git.tdb.fi Git - builder.git/blobdiff - source/binarypackage.cpp
Set PKG_CONFIG_PATH to include prefix
[builder.git] / source / binarypackage.cpp
index f63bff882439c3f8174479d7ff18232e6110f5b2..8cfc87404343cf4704e5dad4c4734e99f70a1a6e 100644 (file)
@@ -1,11 +1,11 @@
 /* $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"
@@ -20,10 +20,6 @@ BinaryPackage::BinaryPackage(Builder &b, const string &n):
        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::FS::Path &p)
 {
        path=builder.get_cwd()/p;
@@ -42,19 +38,7 @@ void BinaryPackage::create_build_info()
 
 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;