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