blob: 2447fa837ffa50e4f11c3c75df2d4e7c695e6bd1 [file] [log] [blame]
Alexander Afanasyevb6392e32014-05-12 23:43:50 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
3from waflib import Logs, Utils, Task, TaskGen
4
5top = '..'
6
7def configure(conf):
taylorchuc27dd482014-05-17 20:06:49 -07008 conf.load(['gnu_dirs', 'qt5'])
Alexander Afanasyevb6392e32014-05-12 23:43:50 -07009
taylorchuc27dd482014-05-17 20:06:49 -070010 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
11 uselib_store='NDN_CXX', mandatory=True)
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070012
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
18def build(bld):
19 app = bld(
taylorchuc27dd482014-05-17 20:06:49 -070020 features=['qt5', 'cxxprogram', 'cxx'],
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070021 includes = ".. .",
22
taylorchuc27dd482014-05-17 20:06:49 -070023 use = "NDN_CXX BOOST QT5CORE QT5DBUS QT5QML QT5WIDGETS",
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070024
25 defines = "WAF",
taylorchuc27dd482014-05-17 20:06:49 -070026 source = bld.path.ant_glob(['*.cpp', '**/*.qrc', '**/*.ui', '**/*.qrc']),
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070027 )
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"
taylorchuc27dd482014-05-17 20:06:49 -070043 app.mac_app = True
44 app.mac_plist = '../osx/Info.plist'
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070045 app.mac_resources = [i.path_from(bld.path)
taylorchuc27dd482014-05-17 20:06:49 -070046 for i in bld.path.parent.ant_glob('osx/Resources/*')]