ExternalConfiguration

class lsst.sconsUtils.dependencies.ExternalConfiguration(cfgFile, headers=(), libs=None, eupsProduct=None)

Bases: Configuration

A Configuration subclass for external (third-party) packages.

Aliased as lsst.sconsUtils.ExternalConfiguration.

ExternalConfiguration doesn’t assume the package uses SWIG or Doxygen, and tells SCons not to consider header files this package provides as dependencies (by setting XCPPPATH instead of CPPPATH). This means things SCons won’t waste time looking for changes in it every time you build. Header files in external packages are treated as “system headers”: that is, most warnings generated when they are being compiled are suppressed.

Parameters:
cfgFilestr

The name of the calling .cfg file, usually just passed in with the special variable __file__. This will be parsed to extract the package name and root.

headerslist, optional

A list of headers provided by the package, to be used in autoconf-style tests.

libslist or dict, optional

A list or dictionary of libraries provided by the package. If a dictionary is provided, libs["main"] should contain a list of regular libraries provided by the library. Other keys are “python” and “test”, which refer to libraries that are only linked against compiled Python modules and unit tests, respectively. If a list is provided, the list is used as “main”. These are used both for autoconf-style tests and to support env.getLibs(…), which recursively computes the libraries a package must be linked with.

eupsProductstr, optional

The EUPS product being built.

Methods Summary

addCustomTests(tests)

Add custom SCons configuration tests to the Configure Context passed to the configure() method.

configure(conf, packages[, check, build])

Update an SCons environment to make use of the package.

getEupsData(eupsProduct)

Get EUPS version and product directory for named product.

parseFilename(cfgFile)

Parse the name of a .cfg file and return package name and root.

Methods Documentation

addCustomTests(tests)

Add custom SCons configuration tests to the Configure Context passed to the configure() method.

This needs to be done up-front so we can pass in a dictionary of custom tests when calling env.Configure(), and use the same configure context for all packages.

Parameters:
testsdict

A dictionary to add custom tests to. This will be passed as the custom_tests argument to env.Configure().

configure(conf, packages, check=False, build=True)

Update an SCons environment to make use of the package.

Parameters:
confSCons.Configure

An SCons Configure context. The SCons Environment conf.env should be updated by the configure function.

packagesdict

A dictionary containing the configuration modules of all dependencies (or None if the dependency was optional and was not found). The <module>.config.configure(...) method will have already been called on all dependencies.

checkbool, optional

If True, perform autoconf-style tests to verify that key components are in fact in place.

buildbool, optional

If True, this is the package currently being built, and packages in “buildRequired” and “buildOptional” dependencies will also be present in the packages dict.

static getEupsData(eupsProduct)

Get EUPS version and product directory for named product.

Parameters:
eupsProductstr

EUPS product name.

Returns:
versionstr

EUPS product version.

productDirstr

EUPS product root directory.

static parseFilename(cfgFile)

Parse the name of a .cfg file and return package name and root.

Parameters:
cfgFilestr

Name of a .cfg file.

Returns:
namestr

Package name

rootstr

Root directory.