Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
| 3 | from waflib import Logs, Utils, Task, TaskGen |
| 4 | |
| 5 | top = '..' |
| 6 | |
| 7 | def configure(conf): |
| 8 | conf.load(['gnu_dirs', 'qt4']) |
| 9 | |
| 10 | # conf.find_program('xsltproc', mandatory=True) |
| 11 | # conf.define('XSLTPROC', conf.env['XSLTPROC']) |
| 12 | |
| 13 | conf.define('RESOURCES_DIR', Utils.subst_vars("${DATAROOTDIR}/nfd-control-center", conf.env)) |
| 14 | |
| 15 | if Utils.unversioned_sys_platform() == "darwin": |
| 16 | conf.define('OSX_BUILD', 1) |
| 17 | |
| 18 | def build(bld): |
| 19 | app = bld( |
| 20 | features=['qt4', 'cxxprogram', 'cxx'], |
| 21 | includes = ".. .", |
| 22 | |
| 23 | use = "QTCORE QTGUI QTXML QTXMLPATTERNS QTDBUS", |
| 24 | |
| 25 | defines = "WAF", |
| 26 | source = bld.path.ant_glob(['*.cpp', '**/*.ui', '**/*.qrc']), |
| 27 | ) |
| 28 | |
| 29 | if Utils.unversioned_sys_platform() != "darwin": |
| 30 | app.target = "../nfd-control-center", |
| 31 | |
| 32 | bld(features = "subst", |
| 33 | source = 'nfd-control-center.desktop.in', |
| 34 | target = 'nfd-control-center.desktop', |
| 35 | BINARY = "nfd-control-center", |
| 36 | install_path = "${DATAROOTDIR}/nfd-control-center" |
| 37 | ) |
| 38 | |
| 39 | bld.install_files("${DATAROOTDIR}/nfd-control-center", |
| 40 | bld.path.ant_glob(['Resources/*'])) |
| 41 | else: |
| 42 | app.target = "../NFD Control Center" |
| 43 | app.mac_app = True, |
| 44 | app.mac_plist = '../osx/Info.plist', |
| 45 | app.mac_resources = [i.path_from(bld.path) |
| 46 | for i in bld.path.ant_glob('../osx/Resources/**/*')], |