Package SCons :: Package Variables :: Module PathVariable'
[hide private]
[frames] | no frames]

Module PathVariable'

source code

SCons.Variables.PathVariable

This file defines an option type for SCons implementing path settings.

To be used whenever a user-specified path override should be allowed.

Arguments to PathVariable are:

option-name = name of this option on the command line (e.g. "prefix") option-help = help string for option option-dflt = default value for this option validator = [optional] validator for option value. Predefined validators are:

PathAccept -- accepts any path setting; no validation PathIsDir -- path must be an existing directory PathIsDirCreate -- path must be a dir; will create PathIsFile -- path must be a file PathExists -- path must exist (any type) [default]

The validator is a function that is called and which should return True or False to indicate if the path is valid. The arguments to the validator function are: (key, val, env). The key is the name of the option, the val is the path specified for the option, and the env is the env to which the Options have been added.

Usage example:

Examples:
    prefix=/usr/local

opts = Variables()

opts = Variables()
opts.Add(PathVariable('qtdir',
                      'where the root of Qt is installed',
                      qtdir, PathIsDir))
opts.Add(PathVariable('qt_includes',
                    'where the Qt includes are installed',
                    '$qtdir/includes', PathIsDirCreate))
opts.Add(PathVariable('qt_libraries',
                    'where the Qt library is installed',
                    '$qtdir/lib'))
Classes [hide private]
  _PathVariableClass
Variables [hide private]
  PathVariable = <SCons.Variables.PathVariable._PathVariableClas...
  __package__ = 'SCons.Variables'
  __revision__ = 'src/engine/SCons/Variables/PathVariable.py 3a4...
Variables Details [hide private]

PathVariable

Value:
<SCons.Variables.PathVariable._PathVariableClass object>

__revision__

Value:
'src/engine/SCons/Variables/PathVariable.py 3a41ed6b288cee8d085373ad7f\
a02894e1903864 2019-01-23 17:30:35 bdeegan'