X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=338b44f43c0e83c10ebd62133533d7bf2b642db0;hb=96e132661ec82c9347f9155d3f30cd99ea8eca47;hp=dd33941c7ed20f6b08b0bf8e4929f26ddf5c57fe;hpb=3aad704c2d2fac737424a0a2697874927bd95c37;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index dd33941..338b44f 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -5,6 +5,7 @@ Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ +#include #include #include #include @@ -109,7 +110,7 @@ void Component::create_targets() const hdr=new Header(builder, this, i->str()); // Install headers if requested - if(!install_headers.empty()) + if(type==HEADERS && install) inst_tgts.push_back(hdr); } } @@ -174,7 +175,7 @@ Component::Loader::Loader(Component &c): { add("source", &Loader::source); add("install", &Component::install); - add("install_headers", &Component::install_headers); + add("install_headers", &Loader::install_headers); add("build_info", &Loader::build_info); add("require", &Loader::require); add("modular", &Loader::modular); @@ -182,6 +183,17 @@ Component::Loader::Loader(Component &c): add("default", &Component::deflt); } +void Component::Loader::finish() +{ + if(!inst_hdr.empty()) + { + Component hdrcomp(comp.pkg, HEADERS, inst_hdr); + hdrcomp.sources=comp.sources; + hdrcomp.install=true; + const_cast(comp.pkg.get_components()).push_back(hdrcomp); + } +} + void Component::Loader::source(const string &s) { comp.sources.push_back(comp.pkg.get_source()/s); @@ -216,6 +228,18 @@ void Component::Loader::host(const string &n) throw Msp::Exception("Unknown component"); } +void Component::Loader::install_headers(const string &p) +{ + cout<