This class inherits from qibuild.worktree.WorkTree, so it has a list of projects.
Example of use:
toc = Toc("/path/to/work/tree", build_type="release")
# Look for the foo project in the worktree
foo = toc.get_project("foo")
# Resolve foo dependencies, call cmake on each of them,
toc.configure_project(foo)
# Build the foo project, building all the dependencies in
# the correct order:
toc.build_project(foo)
Since the class is huge, documentation of the Toc class has been splitted in several parts:
Create a new Toc object. Most of the keyargs come directly from the command line. (–wortree, –debug, -c, etc.)
Parameters: |
|
---|
Return a tuple of three lists: (projects, packages, not_foud), see qibuild.dependencies_solver for more information.
Note that the result depends on how the Toc object has been built.
For instance, assuming you have ‘hello’ depending on ‘world’, and ‘world’ is also a package, you will get:
([‘hello’], [‘world’], []) if user used
$ qibuild configure hello
but:
([‘world’, ‘hello], [], []) if user used:
$ qibuild configure world hello
This is only a small list of Toc attributes.
A qibuild.config.QiBuildConfig instance.
List of objects of type qibuild.project.Project this is updated using qibuild.worktree.WorkTree.buildable_projects
A qitoolchain.toolchain.Toolchain instance. Will be built from the active configuration name.
Thus, self.toolchain.toolchain_file can be passed as -DCMAKE_TOOLCHAIN_FILE argument when calling configure_project(), and self.toolchain.packages can be used to install contents of binary packages when calling install_project()
It always has a “current config”. This config can be:
Creates a Toc object.
Parameters: |
|
---|
You should always use this function to call Toc methods from a qibuild action.
It takes care of all the options you specify from command line, and calls Toc constructor accordingly (see Toc.__init__())
Typical usage from an action is:
def configure_parser(parser):
# Add -c option
qibuild.parsers.toc_parser(parser)
# Add --release, --cmake-generator, -j options:
qibuild.parsers.build_parser(parser)
# Handle specifing zero, one or several project names
# on the command line
qibuild.parser.project_parser(parse)
def do(args):
toc = qibuild.toc.toc_open(args.work_tree, args)
(project_names, _package_names, _not_found) = toc.resolve_deps()
for project_name in project_nanes:
project = toc.get_project(project_name)
# Do something with 'project'