From 30ef78ac307cd2cdf54cba5c0f00a790d5e95066 Mon Sep 17 00:00:00 2001 From: Norton Date: Thu, 20 Dec 2007 00:00:00 +0100 Subject: [PATCH] Scons-Wiki: generate fake target file in output directory (Norton) --- __init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index fd51393e7..9a3f1a134 100644 --- a/__init__.py +++ b/__init__.py @@ -138,7 +138,6 @@ def DoxySourceScan(node, env, path): sources = map( lambda path: env.File(path), sources ) return sources - def DoxySourceScanCheck(node, env): """Check if we should scan this file""" return os.path.isfile(node.path) @@ -159,6 +158,9 @@ def DoxyEmitter(source, target, env): targets = [] out_dir = data.get("OUTPUT_DIRECTORY", ".") + # generate a fake target file in the output directory + targets.append(env.File( os.path.join(out_dir, 'foobar'))) + # add our output locations for (k, v) in output_formats.items(): if data.get("GENERATE_" + k, v[0]) == "YES": @@ -185,13 +187,12 @@ def generate(env): scan_check = DoxySourceScanCheck, ) - doxyfile_builder = env.Builder( - action = env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}"), + import SCons.Builder + doxyfile_builder = SCons.Builder.Builder( + action = "cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file} && touch ${TARGET}", emitter = DoxyEmitter, target_factory = env.fs.Entry, single_source = True, - - source_scanner = doxyfile_scanner, )