Distributed under the LGPL
*/
+#include <iostream>
#include <msp/core/except.h>
#include <msp/fs/dir.h>
#include <msp/fs/stat.h>
hdr=new Header(builder, this, i->str());
// Install headers if requested
- if(!install_headers.empty())
+ if(type==HEADERS && install)
inst_tgts.push_back(hdr);
}
}
{
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);
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<ComponentList &>(comp.pkg.get_components()).push_back(hdrcomp);
+ }
+}
+
void Component::Loader::source(const string &s)
{
comp.sources.push_back(comp.pkg.get_source()/s);
throw Msp::Exception("Unknown component");
}
+void Component::Loader::install_headers(const string &p)
+{
+ cout<<get_source()<<": Note: install_headers is deprecated\n";
+ if(comp.type==HEADERS)
+ {
+ comp.name=p;
+ comp.install=true;
+ }
+ else
+ inst_hdr=p;
+}
+
void Component::Loader::build_info()
{
load_sub(comp.build_info);