]> git.tdb.fi Git - builder.git/blobdiff - source/pkgconfigaction.cpp
Split class Package into SourcePackage and BinaryPackage
[builder.git] / source / pkgconfigaction.cpp
index 9c565f6ddcf5b1dc86588f8eb691b26beae19abe..c390fbd0e0a47dd45ee1e72995513411914e4866 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of builder
+Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include <fstream>
 #include <iostream>
 #include <msp/path/utils.h>
@@ -10,29 +17,29 @@ using namespace std;
 PkgConfigAction::PkgConfigAction(Builder &b, const PkgConfig &p):
        Action(b)
 {
-       const Package &pkg=*p.get_package();
-       
-       announce(pkg.get_name(), "PC", relative(p.get_name(), pkg.get_source()).str());
-       
+       const SourcePackage &spkg=*static_cast<const SourcePackage *>(p.get_package());
+
+       announce(spkg.get_name(), "PC", relative(p.get_name(), spkg.get_source()).str());
+
        ofstream out(p.get_name().c_str());
        if(out)
        {
                // Prefix is already included in the various paths
                //out<<"prefix="<<pkg.get_prefix()<<"\n\n";
-               out<<"source="<<pkg.get_source()<<"\n\n";
-               
-               out<<"Name: "<<pkg.get_name()<<'\n';
-               out<<"Description: "<<pkg.get_description()<<'\n';
-               out<<"Version: "<<pkg.get_version()<<'\n';
-               
+               out<<"source="<<spkg.get_source()<<"\n\n";
+
+               out<<"Name: "<<spkg.get_name()<<'\n';
+               out<<"Description: "<<spkg.get_description()<<'\n';
+               out<<"Version: "<<spkg.get_version()<<'\n';
+
                out<<"Requires:";
-               const PkgRefList &reqs=pkg.get_requires();
+               const PkgRefList &reqs=spkg.get_requires();
                for(PkgRefList::const_iterator i=reqs.begin(); i!=reqs.end(); ++i)
                        if(i->get_package()->get_use_pkgconfig())
                                out<<' '<<i->get_name();
                out<<'\n';
 
-               const BuildInfo &binfo=pkg.get_exported_binfo();
+               const BuildInfo &binfo=spkg.get_exported_binfo();
                out<<"Libs:";
                for(StringList::const_iterator i=binfo.libpath.begin(); i!=binfo.libpath.end(); ++i)
                        out<<" -L"<<*i;