5 #include <msp/datafile/objectloader.h>
6 #include <msp/fs/path.h>
8 #include "installmap.h"
14 Components specify things to be built. Each component may build one binary (it
15 may also build none), as well as install a bunch of headers. Components inherit
16 dependencies and build info from the package they belong to, and may also add
22 class Loader: public Msp::DataFile::ObjectLoader<Component>
27 void source(const std::string &);
28 void require(const std::string &);
43 typedef std::list<Msp::FS::Path> SourceList;
46 SourcePackage &package;
52 Package::Requirements requires;
54 InstallMap install_map;
57 Component(SourcePackage &, Type, const std::string &);
59 const SourcePackage &get_package() const { return package; }
60 Type get_type() const { return type; }
61 const std::string &get_name() const { return name; }
63 /** Returns a list of sources for the component. They may refer to
64 directories or individual files. */
65 const SourceList &get_sources() const { return sources; }
68 /** Returns a list of all source files for the component. */
69 SourceList collect_source_files() const;
72 bool get_install() const { return install; }
73 const InstallMap &get_install_map() const { return install_map; }
74 const Package::Requirements &get_required_packages() const { return requires; }
75 bool is_default() const { return deflt; }
77 /** Prepares any required packages. */
80 /** Prepares the build information for building. Pulls build info from the
81 parent and dependency packages, and adds any component-specific flags. */
82 void create_build_info();
84 const BuildInfo &get_build_info() const { return build_info; }
86 void create_targets() const;