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