LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst.sconsUtils.dependencies.Configuration Class Reference

Base class for defining how to configure an LSST sconsUtils package. More...

Inheritance diagram for lsst.sconsUtils.dependencies.Configuration:
lsst.sconsUtils.dependencies.ExternalConfiguration

Public Member Functions

def __init__
 Initialize the configuration object. More...
 
def addCustomTests
 Add custom SCons configuration tests to the Configure Context passed to the configure() method. More...
 
def configure
 Update an SCons environment to make use of the package. More...
 

Static Public Member Functions

def parseFilename
 Parse the name of a .cfg file, returning the package name and root directory. More...
 
def getEupsData
 

Public Attributes

 root
 
 eupsProduct
 
 version
 
 doxygen
 
 libs
 
 paths
 
 provides
 

Detailed Description

Base class for defining how to configure an LSST sconsUtils package.

Aliased as lsst.sconsUtils.Configuration.

An ups/*.cfg file should contain an instance of this class called "config". Most LSST packages will be able to use this class directly instead of subclassing it.

The only important method is configure(), which modifies an SCons environment to use the package. If a subclass overrides configure, it may not need to call the base class init(), whose only purpose is to define a number of instance variables used by configure().

Definition at line 109 of file dependencies.py.

Constructor & Destructor Documentation

def lsst.sconsUtils.dependencies.Configuration.__init__ (   self,
  cfgFile,
  headers = (),
  libs = None,
  hasSwigFiles = True,
  includeFileDirs = ["include",
  libFileDirs = ["lib",
  hasDoxygenInclude = False,
  hasDoxygenTag = True,
  eupsProduct = None 
)

Initialize the configuration object.

Parameters
cfgFileThe 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.
headersA list of headers provided by the package, to be used in autoconf-style tests.
libsA 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.
hasSwigFilesIf True, the package provides SWIG interface files in "<root>/python".
hasDoxygenIncludeIf True, the package provides a Doxygen include file with the name "<root>/doc/<name>.inc".
hasDoxygenTagIf True, the package generates a Doxygen TAG file.
includeFileDirsList of directories that should be searched for include files
libFileDirsList of directories that should be searched for libraries
eupsProductName of the EUPS product for the package, if different from the name of the .cfg file.

Definition at line 153 of file dependencies.py.

154  hasDoxygenInclude=False, hasDoxygenTag=True, eupsProduct=None):
155  self.name, self.root = self.parseFilename(cfgFile)
156  if eupsProduct is None:
157  eupsProduct = self.name
158  self.eupsProduct = eupsProduct
159  version, productDir = self.getEupsData(self.eupsProduct)
160  if version is not None:
161  self.version = version
162  if productDir is None:
163  state.log.warn("Could not find EUPS product dir for '%s'; using %s."
164  % (self.eupsProduct, self.root))
165  else:
166  self.root = os.path.realpath(productDir)
167  self.doxygen = {
168  # Doxygen tag files generated by this package
169  "tags": ([os.path.join(self.root, "doc", "%s.tag" % self.name)]
170  if hasDoxygenTag else []),
171  # Doxygen include files to include in the configuration of dependent products
172  "includes": ([os.path.join(self.root, "doc", "%s.inc" % self.name)]
173  if hasDoxygenInclude else [])
174  }
175  if libs is None:
176  self.libs = {
177  # Normal libraries provided by this package
178  "main": [self.name],
179  # Libraries provided that should only be linked with Python modules
180  "python":[],
181  # Libraries provided that should only be linked with unit test code
182  "test":[],
183  }
184  elif "main" in libs:
185  self.libs = libs
186  else:
187  self.libs = {"main": libs, "python": [], "test": []}
188  self.paths = {}
189  if hasSwigFiles:
190  self.paths["SWIGPATH"] = [os.path.join(self.root, "python")]
191  else:
192  self.paths["SWIGPATH"] = []
193 
194  for pathName, subDirs in [("CPPPATH", includeFileDirs),
195  ("LIBPATH", libFileDirs),]:
196  self.paths[pathName] = []
197 
198  if state.env.linkFarmDir:
199  continue
200 
201  for subDir in subDirs:
202  pathDir = os.path.join(self.root, subDir)
203  if os.path.isdir(pathDir):
204  self.paths[pathName].append(pathDir)
206  self.provides = {
207  "headers": tuple(headers),
208  "libs": tuple(self.libs["main"])
209  }
def parseFilename
Parse the name of a .cfg file, returning the package name and root directory.

Member Function Documentation

def lsst.sconsUtils.dependencies.Configuration.addCustomTests (   self,
  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
testsA dictionary to add custom tests to. This will be passed as the custom_tests argument to env.Configure().

Definition at line 220 of file dependencies.py.

221  def addCustomTests(self, tests):
222  pass
def addCustomTests
Add custom SCons configuration tests to the Configure Context passed to the configure() method...
def lsst.sconsUtils.dependencies.Configuration.configure (   self,
  conf,
  packages,
  check = False,
  build = True 
)

Update an SCons environment to make use of the package.

Parameters
confAn SCons Configure context. The SCons Environment conf.env should be updated by the configure function.
packagesA 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.
checkIf True, perform autoconf-style tests to verify that key components are in fact in place.
buildIf True, this is the package currently being built, and packages in "buildRequired" and "buildOptional" dependencies will also be present in the packages dict.

Definition at line 237 of file dependencies.py.

238  def configure(self, conf, packages, check=False, build=True):
239  assert(not (check and build))
240  conf.env.PrependUnique(**self.paths)
241  state.log.info("Configuring package '%s'." % self.name)
242  conf.env.doxygen["includes"].extend(self.doxygen["includes"])
243  if not build:
244  conf.env.doxygen["tags"].extend(self.doxygen["tags"])
245  for target in self.libs:
246  if target not in conf.env.libs:
247  conf.env.libs[target] = lib[target].copy()
248  state.log.info("Adding '%s' libraries to target '%s'." % (self.libs[target], target))
249  else:
250  for lib in self.libs[target]:
251  if lib not in conf.env.libs[target]:
252  conf.env.libs[target].append(lib)
253  state.log.info("Adding '%s' library to target '%s'." % (lib, target))
254  if check:
255  for header in self.provides["headers"]:
256  if not conf.CheckCXXHeader(header): return False
257  for lib in self.libs["main"]:
258  if not conf.CheckLib(lib, autoadd=False, language="C++"): return False
259  return True
260 
261 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
SelectEigenView< T >::Type copy(Eigen::EigenBase< T > const &other)
Copy an arbitrary Eigen expression into a new EigenView.
Definition: eigen.h:390
def configure
Update an SCons environment to make use of the package.
def lsst.sconsUtils.dependencies.Configuration.getEupsData (   eupsProduct)
static

Definition at line 119 of file dependencies.py.

120  def getEupsData(eupsProduct):
121  version, eupsPathDir, productDir, table, flavor = eupsForScons.getEups().findSetupVersion(eupsProduct)
122  if productDir is None:
123  productDir = eupsForScons.productDir(eupsProduct)
124  return version, productDir
def lsst.sconsUtils.dependencies.Configuration.parseFilename (   cfgFile)
static

Parse the name of a .cfg file, returning the package name and root directory.

Definition at line 113 of file dependencies.py.

114  def parseFilename(cfgFile):
115  dir, file = os.path.split(cfgFile)
116  name, ext = os.path.splitext(file)
117  return name, os.path.abspath(os.path.join(dir, ".."))
def parseFilename
Parse the name of a .cfg file, returning the package name and root directory.

Member Data Documentation

lsst.sconsUtils.dependencies.Configuration.doxygen

Definition at line 166 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.eupsProduct

Definition at line 157 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.libs

Definition at line 175 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.paths

Definition at line 187 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.provides

Definition at line 205 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.root

Definition at line 154 of file dependencies.py.

lsst.sconsUtils.dependencies.Configuration.version

Definition at line 160 of file dependencies.py.


The documentation for this class was generated from the following file: