1 #ifndef PACKAGEMANAGER_H_
2 #define PACKAGEMANAGER_H_
7 #include <msp/fs/path.h>
13 Keeps track of packages. Also responsible for locating previously unknown
19 typedef std::map<std::string, Package *> PackageMap;
22 typedef std::list<Msp::FS::Path> SearchPath;
32 PackageManager(Builder &);
35 /** Prevent creation of source packages. */
36 void set_no_externals(bool);
38 /** Adds a package to the manager. Called from Package constructor. */
39 void add_package(Package *);
41 /** Returns a package from the cache. */
42 Package *get_package(const std::string &);
44 const PackageMap &get_packages() const { return packages; }
46 /** Locates a package and creates it if necessary. */
47 Package *find_package(const std::string &);
50 std::string run_pkgconfig(const std::string &, const std::string &);
52 /** Determines the source directory of a package. Pkg-config is consulted
53 first, and if it fails, the package path is searched for matches. */
54 Msp::FS::Path get_package_location(const std::string &);