wscript 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2005, 2011 (ita)
  4. """
  5. Including the moc files *is* the best practice (KDE), not doing it is easy,
  6. but makes the compilations about 30-40% slower on average.
  7. If you still want the slow version (we warned you!), see the example located
  8. in the folder playground/slow_qt/
  9. """
  10. VERSION='0.0.1'
  11. APPNAME='qt4_test'
  12. top = '.'
  13. out = 'build'
  14. def options(opt):
  15. opt.load('compiler_cxx qt4')
  16. def configure(conf):
  17. conf.load('compiler_cxx qt4')
  18. conf.env.append_value('CXXFLAGS', ['-g']) # test
  19. def build(bld):
  20. bld(
  21. features = 'qt4 cxx cxxprogram',
  22. uselib = 'QTCORE QTGUI QTOPENGL QTSVG',
  23. source = 'main.cpp textures.qrc but.ui foo.cpp',
  24. target = 'window',
  25. includes = '.',
  26. defines = 'WAF=1', # test
  27. lang = bld.path.ant_glob('linguist/*.ts'),
  28. langname = 'somefile', # include the .qm files from somefile.qrc
  29. )
  30. # use the following if you want to add the include paths automatically
  31. """
  32. from waflib.TaskGen import feature, before, after
  33. @feature('cxx')
  34. @after('process_source')
  35. @before('apply_incpaths')
  36. def add_includes_paths(self):
  37. incs = set(self.to_list(getattr(self, 'includes', '')))
  38. for x in self.compiled_tasks:
  39. incs.add(x.inputs[0].parent.path_from(self.path))
  40. self.includes = list(incs)
  41. """