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): |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 8 | conf.load(['gnu_dirs', 'qt5']) |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 9 | |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 10 | conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], |
| 11 | uselib_store='NDN_CXX', mandatory=True) |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 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( |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 20 | features=['qt5', 'cxxprogram', 'cxx'], |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 21 | includes = ".. .", |
| 22 | |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 23 | use = "NDN_CXX BOOST QT5CORE QT5DBUS QT5QML QT5WIDGETS", |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 24 | |
| 25 | defines = "WAF", |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 26 | source = bld.path.ant_glob(['*.cpp', '**/*.qrc', '**/*.ui', '**/*.qrc']), |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 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" |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 43 | app.mac_app = True |
| 44 | app.mac_plist = '../osx/Info.plist' |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 45 | app.mac_resources = [i.path_from(bld.path) |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 46 | for i in bld.path.parent.ant_glob('osx/Resources/*')] |