]> git.tdb.fi Git - builder.git/blobdiff - source/install.cpp
Split class Package into SourcePackage and BinaryPackage
[builder.git] / source / install.cpp
index ca32348f324e02d289159d0030037ab0edb84b31..2cdd1aa1a4a959c6f34f754a273a8b9ffbf5497b 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 <msp/path/utils.h>
 #include "builder.h"
 #include "copy.h"
@@ -11,7 +18,7 @@
 using namespace std;
 using namespace Msp;
 
-Install::Install(Builder &b, const Package &p, Target &tgt):
+Install::Install(Builder &b, const SourcePackage &p, Target &tgt):
        Target(b, &p, generate_target_name(tgt))
 {
        buildable=true;
@@ -39,7 +46,9 @@ Action *Install::build()
 
 string Install::generate_target_name(const Target &tgt)
 {
-       Path::Path base=tgt.get_package()->get_prefix();
+       const SourcePackage *spkg=dynamic_cast<const SourcePackage *>(tgt.get_package());
+
+       Path::Path base=spkg->get_prefix();
        string tgtname=tgt.get_name().substr(tgt.get_name().rfind('/')+1);
 
        string mid;