ImportProject

Returns:  The project class instance.

ImportLibraries

Returns:  A dictionary of all the known libraries that have been imported

ImportLibrary

Returns: A dictionary of all the known libraries that have been imported

UseLibraries

Returns:  A list of file specs that can be used directly in the builder LIBS = ...

UseLibrary

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

Perhaps for symmetry, there should be a prj.ImportInclude, since the currently the only way to access the include is via an ImportProject call….

EXAMPLES

  1. prj = env.ImportProject ()
    since no name is provided, the local project is targeted
  2. core = env.ImportProject (name = ‘CORE’)
    access the project named core.  Since this one is pre-initialized, this is an access, not a creation
  3. 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.