Alexander Afanasyev | 749f065 | 2013-09-22 13:03:21 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 2 | VERSION='0.1' |
| 3 | APPNAME='nfd-control-center' |
Alexander Afanasyev | 749f065 | 2013-09-22 13:03:21 -0700 | [diff] [blame] | 4 | |
| 5 | from waflib import Logs, Utils, Task, TaskGen |
| 6 | |
| 7 | def options(opt): |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 8 | opt.load('compiler_c compiler_cxx qt5 gnu_dirs') |
| 9 | opt.load('msvs boost sparkle xcode default-compiler-flags', tooldir='.waf-tools') |
Alexander Afanasyev | 749f065 | 2013-09-22 13:03:21 -0700 | [diff] [blame] | 10 | |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 11 | # grp = opt.add_option_group('NFD Control Center options') |
Alexander Afanasyev | a822b57 | 2013-11-04 12:36:34 -0800 | [diff] [blame] | 12 | |
Alexander Afanasyev | 749f065 | 2013-09-22 13:03:21 -0700 | [diff] [blame] | 13 | def configure(conf): |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 14 | conf.load('compiler_c compiler_cxx qt5 default-compiler-flags boost') |
Alexander Afanasyev | 6cacb97 | 2013-10-03 23:39:06 -0700 | [diff] [blame] | 15 | |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 16 | conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'], |
| 17 | uselib_store='NDN_CXX', mandatory=True) |
Alexander Afanasyev | 86240d0 | 2013-11-08 23:32:53 -0800 | [diff] [blame] | 18 | |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 19 | conf.check_boost(lib="system thread") |
| 20 | |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 21 | # conf.define('RESOURCES_DIR', Utils.subst_vars("${DATAROOTDIR}/nfd-control-center", conf.env)) |
| 22 | |
| 23 | if Utils.unversioned_sys_platform() == "darwin": |
| 24 | conf.define('OSX_BUILD', 1) |
Alexander Afanasyev | eb11157 | 2013-11-08 22:59:43 -0800 | [diff] [blame] | 25 | |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 26 | conf.write_config_header('config.hpp') |
Alexander Afanasyev | 2beff7f | 2013-09-27 17:50:36 -0700 | [diff] [blame] | 27 | |
Alexander Afanasyev | b6392e3 | 2014-05-12 23:43:50 -0700 | [diff] [blame] | 28 | def build(bld): |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 29 | app = bld( |
| 30 | features=['qt5', 'cxxprogram', 'cxx'], |
| 31 | includes = ". src", |
| 32 | |
| 33 | use = "NDN_CXX BOOST QT5CORE QT5DBUS QT5QML QT5WIDGETS", |
| 34 | |
| 35 | defines = "WAF", |
| 36 | source = bld.path.ant_glob(['src/*.cpp', 'src/**/*.qrc', 'src/**/*.ui', 'src/**/*.qrc']), |
| 37 | ) |
| 38 | |
| 39 | if Utils.unversioned_sys_platform() != "darwin": |
susmit | 90b7182 | 2016-03-20 13:31:23 -0600 | [diff] [blame] | 40 | app.target = "nfd-control-center" |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 41 | |
| 42 | bld(features = "subst", |
| 43 | source = 'src/nfd-control-center.desktop.in', |
| 44 | target = 'src/nfd-control-center.desktop', |
| 45 | BINARY = "nfd-control-center", |
| 46 | install_path = "${DATAROOTDIR}/nfd-control-center" |
| 47 | ) |
| 48 | |
| 49 | bld.install_files("${DATAROOTDIR}/nfd-control-center", |
| 50 | bld.path.ant_glob(['Resources/*'])) |
Alexander Afanasyev | a822b57 | 2013-11-04 12:36:34 -0800 | [diff] [blame] | 51 | else: |
Alexander Afanasyev | e334215 | 2016-03-20 11:23:57 -0700 | [diff] [blame] | 52 | app.target = "NFD Control Center" |
| 53 | app.mac_app = True |
| 54 | # app.mac_plist = 'src/Info.plist' |
| 55 | # app.mac_resources = [i.path_from(bld.path) |
| 56 | # for i in bld.path.parent.ant_glob('src/Resources/*')] |