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

Module PathVariable'

source code


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:


opts = Variables()

opts = Variables()
                      'where the root of Qt is installed',
                      qtdir, PathIsDir))
                    'where the Qt includes are installed',
                    '$qtdir/includes', PathIsDirCreate))
                    'where the Qt library is installed',
Classes [hide private]
Variables [hide private]
  PathVariable = SCons.Variables.PathVariable
  __package__ = 'SCons.Variables'
  __revision__ = 'src/engine/SCons/Variables/ 74b...
Variables Details [hide private]


'src/engine/SCons/Variables/ 74b2c53bc42290e911b334a6b4\
4f187da698a668 2017/11/14 13:16:53 bdbaddog'