5 #include <msp/datafile/objectloader.h>
6 #include <msp/fs/path.h>
11 Maps install locations based on location in the source tree. Mappings are
12 defined as pairs of source and install locations. Targets within a source
13 location are mapped if their default install location shares a common prefix
14 with the mapped install location. The remainder of the source location is
15 appended to the mapped install location to form the final install location.
20 class Loader: public Msp::DataFile::ObjectLoader<InstallMap>
23 Msp::FS::Path source_base;
26 Loader(InstallMap &, const Msp::FS::Path &);
29 void map(const std::string &, const std::string &);
36 Msp::FS::Path install;
39 std::list<Entry> entries;
42 /** Adds an install mapping. Multiple mappings can be specified for the
43 same source location, but the first one that matches both that and the
44 target's default install location will be used. */
45 void add_mapping(const Msp::FS::Path &, const Msp::FS::Path &);
47 /** Returns the install location for a target. If no defined mappings match
48 the target, its default install location is returned. */
49 Msp::FS::Path get_install_location(const FileTarget &) const;