Returns: The project class instance.
Returns: A dictionary of all the known libraries that have been imported
Returns: A dictionary of all the known libraries that have been imported
Returns: A list of file specs that can be used directly in the builder LIBS = ...
Returns: A single library file spec that can be used directly in the builder
The UseLibrary/UseLibraries can be thought of as a translation of generic library names into library file specs, i.e. something that can be used in a builders LIB =
argument.
These methods work from either
The env
env
maintains a dictionary of named projects (the name is provided as an argument to ImportProject, if not provided, the local project is assumed). Effectively this call just looks up the named project in this dictionary to locate its class instance. (If it doesn’t find it, a new named project is created).env
provides one the ability to communicate information from one Sconscript
to the other, using the project name as a locatorPerhaps for symmetry, there should be a prj.ImportInclude, since the currently the only way to access the include is via an ImportProject call….
prj = env.ImportProject ()
core = env.ImportProject (name = ‘CORE’)
csc = env.ImportProject (name = ‘CSC’)
If the project was previously created, it is just accessed.
If not, the project is created, using the current project as a template, i.e. it assumes the same include and library directory layout, as it does the library prefix and suffix. If these need customizing the full call is
env.ImportProject (name = <name>, root = <root_directory>, incdir = <include_directory>, (can be absolute or relative to root, eg ‘inc’), libdir = <library_directory>, (can be absolute or relative to root, ‘iib’), pkgdir = <package_directory>, (this is not too useful), libprefix = <library_prefix> , (eg ‘lib’), libsuffix = <library_suffix>, (eg ‘.so’) |
Here’s the call I use to initialize the ‘CORE’ project
env.ImportProject (name = 'CORE', incdir = paths.inc_core, libdir = paths.lib) |
If one had a need or desire to tailor each individual package, then the ‘pkgdir’ would be useful.
Effectively one could create a ‘Project’ for each package.
The pkgdir can be a list representing the subdirectory path, e.g., pkgdir=(x,y,z)
gets used as x/y/z.