(module_name, filename, paths, must_find=False)
| 174 | # configuration file or nothing if no file was loaded. |
| 175 | # |
| 176 | def load_config(module_name, filename, paths, must_find=False): |
| 177 | |
| 178 | if debug_config: |
| 179 | print "notice: Searching '%s' for '%s' configuration file '%s." \ |
| 180 | % (paths, module_name, filename) |
| 181 | |
| 182 | where = None |
| 183 | for path in paths: |
| 184 | t = os.path.join(path, filename) |
| 185 | if os.path.exists(t): |
| 186 | where = t |
| 187 | break |
| 188 | |
| 189 | if where: |
| 190 | where = os.path.realpath(where) |
| 191 | |
| 192 | if debug_config: |
| 193 | print "notice: Loading '%s' configuration file '%s' from '%s'." \ |
| 194 | % (module_name, filename, where) |
| 195 | |
| 196 | # Set source location so that path-constant in config files |
| 197 | # with relative paths work. This is of most importance |
| 198 | # for project-config.jam, but may be used in other |
| 199 | # config files as well. |
| 200 | attributes = get_manager().projects().attributes(module_name) ; |
| 201 | attributes.set('source-location', os.path.dirname(where), True) |
| 202 | get_manager().projects().load_standalone(module_name, where) |
| 203 | |
| 204 | else: |
| 205 | msg = "Configuration file '%s' not found in '%s'." % (filename, path) |
| 206 | if must_find: |
| 207 | get_manager().errors()(msg) |
| 208 | |
| 209 | elif debug_config: |
| 210 | print msg |
| 211 | |
| 212 | return where |
| 213 | |
| 214 | # Loads all the configuration files used by Boost Build in the following order: |
| 215 | # |
no test coverage detected