fluid.py 862 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/python
  2. # encoding: utf-8
  3. # Grygoriy Fuchedzhy 2009
  4. """
  5. Compile fluid files (fltk graphic library). Use the 'fluid' feature in conjunction with the 'cxx' feature.
  6. """
  7. from waflib import Task
  8. from waflib.TaskGen import extension
  9. class fluid(Task.Task):
  10. color = 'BLUE'
  11. ext_out = ['.h']
  12. run_str = '${FLUID} -c -o ${TGT[0].abspath()} -h ${TGT[1].abspath()} ${SRC}'
  13. @extension('.fl')
  14. def process_fluid(self, node):
  15. """add the .fl to the source list; the cxx file generated will be compiled when possible"""
  16. cpp = node.change_ext('.cpp')
  17. hpp = node.change_ext('.hpp')
  18. self.create_task('fluid', node, [cpp, hpp])
  19. if 'cxx' in self.features:
  20. self.source.append(cpp)
  21. def configure(conf):
  22. conf.find_program('fluid', var='FLUID')
  23. conf.check_cfg(path='fltk-config', package='', args='--cxxflags --ldflags', uselib_store='FLTK', mandatory=True)