]> git.tdb.fi Git - builder.git/blobdiff - source/lib/installcomponent.cpp
Rearrange sources into subdirectories
[builder.git] / source / lib / installcomponent.cpp
diff --git a/source/lib/installcomponent.cpp b/source/lib/installcomponent.cpp
new file mode 100644 (file)
index 0000000..86919fa
--- /dev/null
@@ -0,0 +1,23 @@
+#include "installcomponent.h"
+#include "builder.h"
+#include "file.h"
+#include "sourcepackage.h"
+#include "tool.h"
+
+using namespace std;
+using namespace Msp;
+
+void InstallComponent::create_targets() const
+{
+       Builder &builder = package.get_builder();
+       Target *inst = builder.get_build_graph().get_target("install");
+       Tool &copy = builder.get_toolchain().get_tool("CP");
+
+       for(const FS::Path &s: collect_source_files())
+       {
+               Target *tgt = builder.get_vfs().get_target(s);
+               if(!tgt)
+                       tgt = new File(builder, package, s);
+               inst->add_dependency(*copy.create_target(*tgt, name));
+       }
+}