Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.
Differences between revisions 4 and 5
Revision 4 as of 2007-09-19 13:56:24
Size: 1620
Editor: axiom-investment
Comment:
Revision 5 as of 2008-03-12 02:46:58
Size: 1622
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The FltkFluidBuilder creates C++ source and header files from Fluid's .fl files. Fluid is the graphical GUI editor of the GUI toolkit [http://fltk.org FLTK]. The FltkFluidBuilder creates C++ source and header files from Fluid's .fl files. Fluid is the graphical GUI editor of the GUI toolkit [[http://fltk.org|FLTK]].
Line 42: Line 42:
-- ["hirsch"] [[DateTime(2006-08-11T10:54:26Z)]] -- [[hirsch]] <<DateTime(2006-08-11T10:54:26Z)>>

The FltkFluidBuilder creates C++ source and header files from Fluid's .fl files. Fluid is the graphical GUI editor of the GUI toolkit FLTK. Simply add the .fl files to the list of sources to be compiled.

   1 sources = Split("""main.cpp UserInterface.fl""")

The builder will create two files: fluid_UserInterface.h and fluid_UserInterface.cxx and adds them to the list of sources to be built.

Here's the builder and emitter + registration:

   1 import os
   2 import Scons.Util
   3 
   4 # emitter to add the generated .h file to the dependencies
   5 def fluidEmitter(target, source, env):
   6   adjustixes = SCons.Util.adjustixes
   7   file = SCons.Util.splitext(str(source[0].name))[0]
   8   file = os.path.join(str(target[0].get_dir()), file)
   9   target.append(adjustixes(file, "fluid_", ".h"))
  10   return target, source
  11 
  12 fluidBuilder = Builder(action = "cd ${SOURCE.dir} && " + 
  13                                 "fluid -o fluid_${SOURCE.filebase}.cxx " + 
  14                                 "-h fluid_${SOURCE.filebase}.h -c ${SOURCE.name} ",
  15                         emitter = fluidEmitter,
  16                         src_suffix = '.fl',
  17                         suffix = '.cxx',
  18                         prefix = 'fluid_')
  19 
  20 # register builder
  21 env.Append( BUILDERS = { 'Fluid': fluidBuilder } )
  22 
  23 # add builder to the builders for shared and static objects, 
  24 # so we can use all sources in one list
  25 shared, static = SCons.Tool.createObjBuilders(env)
  26 shared.src_builder.append('Fluid')
  27 static.src_builder.append('Fluid')

-- hirsch 2006-08-11 10:54:26

FltkFluidBuilder (last edited 2008-03-12 02:46:58 by localhost)