]> git.tdb.fi Git - builder.git/blobdiff - source/install.cpp
Remove a useless path-to-string conversion
[builder.git] / source / install.cpp
index ecf50ee6cfa1e73f8c8e62d4f7d05f4a6778fc01..bfda555cda9269c962c2d683d1eae5518c7dc9bb 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2006-2010  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <msp/fs/utils.h>
 #include "builder.h"
 #include "copy.h"
@@ -26,6 +19,13 @@ Install::Install(Builder &b, const SourcePackage &p, FileTarget &s, const std::s
 {
        buildable = true;
        add_depend(&source);
+
+       if(const SharedLibrary *shlib = dynamic_cast<const SharedLibrary *>(&source))
+               if(!shlib->get_soname().empty())
+                       link = FS::dirname(path)/FS::basename(shlib->get_path());
+
+       if(!link.empty())
+               builder.register_path(link, this);
 }
 
 Target *Install::get_real_target()
@@ -45,7 +45,7 @@ void Install::check_rebuild()
 
 Action *Install::create_action()
 {
-       return new Copy(builder, *package, source.get_path(), path);
+       return new Copy(builder, *package, source.get_path(), path, link);
 }
 
 FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string &loc)
@@ -89,5 +89,5 @@ FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string
        if(mid.empty())
                throw invalid_argument("Don't know where to install "+tgtname);
 
-       return (base/mid/tgtname).str();
+       return base/mid/tgtname;
 }