blob: 4920f074bcfc7d54e6ac561eb4cd302adb1c5b9c [file] [log] [blame]
Alexander Afanasyev749f0652013-09-22 13:03:21 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Alexander Afanasyevb6392e32014-05-12 23:43:50 -07002VERSION='0.1'
3APPNAME='nfd-control-center'
Alexander Afanasyev749f0652013-09-22 13:03:21 -07004
5from waflib import Logs, Utils, Task, TaskGen
6
7def options(opt):
Alexander Afanasyeve3342152016-03-20 11:23:57 -07008 opt.load('compiler_c compiler_cxx qt5 gnu_dirs')
9 opt.load('msvs boost sparkle xcode default-compiler-flags', tooldir='.waf-tools')
Alexander Afanasyev749f0652013-09-22 13:03:21 -070010
Alexander Afanasyeve3342152016-03-20 11:23:57 -070011 # grp = opt.add_option_group('NFD Control Center options')
Alexander Afanasyeva822b572013-11-04 12:36:34 -080012
Alexander Afanasyev749f0652013-09-22 13:03:21 -070013def configure(conf):
Alexander Afanasyeve3342152016-03-20 11:23:57 -070014 conf.load('compiler_c compiler_cxx qt5 default-compiler-flags boost')
Alexander Afanasyev6cacb972013-10-03 23:39:06 -070015
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070016 conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
17 uselib_store='NDN_CXX', mandatory=True)
Alexander Afanasyev86240d02013-11-08 23:32:53 -080018
taylorchuc27dd482014-05-17 20:06:49 -070019 conf.check_boost(lib="system thread")
20
Alexander Afanasyeve3342152016-03-20 11:23:57 -070021 # 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 Afanasyeveb111572013-11-08 22:59:43 -080025
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070026 conf.write_config_header('config.hpp')
Alexander Afanasyev2beff7f2013-09-27 17:50:36 -070027
Alexander Afanasyevb6392e32014-05-12 23:43:50 -070028def build(bld):
Alexander Afanasyeve3342152016-03-20 11:23:57 -070029 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":
40 app.target = "nfd-control-center",
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 Afanasyeva822b572013-11-04 12:36:34 -080051 else:
Alexander Afanasyeve3342152016-03-20 11:23:57 -070052 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/*')]