Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
Alexander Afanasyev | 71b43e7 | 2012-12-27 01:03:43 -0800 | [diff] [blame] | 2 | VERSION='0.1' |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 3 | APPNAME='chronoshare' |
| 4 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 5 | from waflib import Build, Logs, Utils |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 6 | |
| 7 | def options(opt): |
| 8 | opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''') |
| 9 | opt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''') |
Alexander Afanasyev | 71b43e7 | 2012-12-27 01:03:43 -0800 | [diff] [blame] | 10 | opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility |
Alexander Afanasyev | c507ac2 | 2013-01-21 16:01:58 -0800 | [diff] [blame] | 11 | opt.add_option('--log4cxx', action='store_true',default=False,dest='log4cxx',help='''Compile with log4cxx logging support''') |
Alexander Afanasyev | 5f9d09e | 2012-12-28 19:43:08 -0800 | [diff] [blame] | 12 | |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 13 | if Utils.unversioned_sys_platform () == "darwin": |
Zhenkai Zhu | bb170d4 | 2013-02-25 13:48:59 -0800 | [diff] [blame] | 14 | opt.add_option('--auto-update', action='store_true',default=False,dest='autoupdate',help='''(OSX) Download sparkle framework and enable autoupdate feature''') |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 15 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 16 | opt.load('compiler_c compiler_cxx boost ccnx protoc qt4') |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 17 | |
| 18 | def configure(conf): |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 19 | conf.load("compiler_c compiler_cxx") |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 20 | |
Alexander Afanasyev | a1b7bb5 | 2013-02-26 17:04:02 -0800 | [diff] [blame] | 21 | # I wish I could use it, but there is some weirdness with boost tests. Give up for now |
| 22 | # try: |
| 23 | # conf.check(features='cxx cxxprogram', cxxflags="-std=c++11") |
| 24 | # conf.env.append_value ('CXXFLAGS', ["-std=c++11"]) |
| 25 | # except: |
| 26 | # try: |
| 27 | # conf.check(features='cxx cxxprogram', cxxflags="-std=c++0x") |
| 28 | # conf.env.append_value ('CXXFLAGS', ["-std=c++0x"]) |
| 29 | # except: |
| 30 | # conf.fatal ("You compiler doesn't support C++11. You can try GCC >= 4.4 or recent version of Clang.") |
| 31 | |
Alexander Afanasyev | f289063 | 2013-01-02 13:40:02 -0800 | [diff] [blame] | 32 | conf.define ("CHRONOSHARE_VERSION", VERSION) |
| 33 | |
Alexander Afanasyev | 71b43e7 | 2012-12-27 01:03:43 -0800 | [diff] [blame] | 34 | conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True) |
Zhenkai Zhu | bc2f628 | 2013-01-08 16:40:58 -0800 | [diff] [blame] | 35 | conf.check_cfg(package='libevent', args=['--cflags', '--libs'], uselib_store='LIBEVENT', mandatory=True) |
| 36 | conf.check_cfg(package='libevent_pthreads', args=['--cflags', '--libs'], uselib_store='LIBEVENT_PTHREADS', mandatory=True) |
| 37 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 38 | if Utils.unversioned_sys_platform () == "darwin": |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 39 | conf.check_cxx(framework_name='Foundation', uselib_store='OSX_FOUNDATION', mandatory=False, compile_filename='test.mm') |
| 40 | conf.check_cxx(framework_name='CoreWLAN', uselib_store='OSX_COREWLAN', define_name='HAVE_COREWLAN', mandatory=False, compile_filename='test.mm') |
| 41 | |
| 42 | if conf.options.autoupdate: |
Zhenkai Zhu | bb170d4 | 2013-02-25 13:48:59 -0800 | [diff] [blame] | 43 | def check_sparkle(**kwargs): |
| 44 | conf.check_cxx (framework_name='Sparkle', header_name="Foundation/Foundation.h", |
| 45 | uselib_store='OSX_SPARKLE', define_name='HAVE_SPARKLE', mandatory=True, |
| 46 | compile_filename='test.mm', |
| 47 | **kwargs |
| 48 | ) |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 49 | try: |
| 50 | # Try standard paths first |
Zhenkai Zhu | bb170d4 | 2013-02-25 13:48:59 -0800 | [diff] [blame] | 51 | check_sparkle() |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 52 | except: |
| 53 | try: |
| 54 | # Try local path |
| 55 | Logs.info ("Check local version of Sparkle framework") |
Alexander Afanasyev | 7c85d57 | 2013-02-26 22:06:54 -0800 | [diff] [blame] | 56 | check_sparkle(cxxflags="-F%s/osx/Frameworks/" % conf.path.abspath(), |
| 57 | linkflags="-F%s/osx/Frameworks/" % conf.path.abspath()) |
| 58 | conf.env.HAVE_LOCAL_SPARKLE = 1 |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 59 | except: |
| 60 | # Download to local path and retry |
| 61 | Logs.info ("Sparkle framework not found, trying to download it to 'build/'") |
| 62 | |
Alexander Afanasyev | a1b7bb5 | 2013-02-26 17:04:02 -0800 | [diff] [blame] | 63 | import urllib, subprocess, os, shutil |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 64 | urllib.urlretrieve ("http://sparkle.andymatuschak.org/files/Sparkle%201.5b6.zip", "build/Sparkle.zip") |
Zhenkai Zhu | bb170d4 | 2013-02-25 13:48:59 -0800 | [diff] [blame] | 65 | if os.path.exists('build/Sparkle.zip'): |
Alexander Afanasyev | a1b7bb5 | 2013-02-26 17:04:02 -0800 | [diff] [blame] | 66 | try: |
| 67 | subprocess.check_call (['unzip', '-qq', 'build/Sparkle.zip', '-d', 'build/Sparkle']) |
| 68 | os.remove ("build/Sparkle.zip") |
| 69 | if not os.path.exists("osx/Frameworks"): |
| 70 | os.mkdir ("osx/Frameworks") |
| 71 | os.rename ("build/Sparkle/Sparkle.framework", "osx/Frameworks/Sparkle.framework") |
| 72 | shutil.rmtree("build/Sparkle", ignore_errors=True) |
| 73 | |
Alexander Afanasyev | 7c85d57 | 2013-02-26 22:06:54 -0800 | [diff] [blame] | 74 | check_sparkle(cxxflags="-F%s/osx/Frameworks/" % conf.path.abspath(), |
| 75 | linkflags="-F%s/osx/Frameworks/" % conf.path.abspath()) |
| 76 | conf.env.HAVE_LOCAL_SPARKLE = 1 |
Alexander Afanasyev | a1b7bb5 | 2013-02-26 17:04:02 -0800 | [diff] [blame] | 77 | except subprocess.CalledProcessError as e: |
| 78 | conf.fatal("Cannot find Sparkle framework. Auto download failed: '%s' returned %s" % (' '.join(e.cmd), e.returncode)) |
| 79 | except: |
| 80 | conf.fatal("Unknown Error happened when auto downloading Sparkle framework") |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 81 | |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 82 | if conf.is_defined('HAVE_SPARKLE'): |
| 83 | conf.env.HAVE_SPARKLE = 1 # small cheat for wscript |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 84 | |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 85 | if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False): |
Alexander Afanasyev | 5f9d09e | 2012-12-28 19:43:08 -0800 | [diff] [blame] | 86 | libcrypto = conf.check_cc(lib='crypto', |
| 87 | header_name='openssl/crypto.h', |
| 88 | define_name='HAVE_SSL', |
| 89 | uselib_store='SSL') |
| 90 | else: |
| 91 | conf.define ("HAVE_SSL", 1) |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 92 | if not conf.get_define ("HAVE_SSL"): |
| 93 | conf.fatal ("Cannot find SSL libraries") |
| 94 | |
Alexander Afanasyev | c507ac2 | 2013-01-21 16:01:58 -0800 | [diff] [blame] | 95 | if conf.options.log4cxx: |
| 96 | conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX', mandatory=True) |
| 97 | conf.define ("HAVE_LOG4CXX", 1) |
| 98 | |
Zhenkai Zhu | 0a17aea | 2012-12-28 14:30:22 -0800 | [diff] [blame] | 99 | conf.load ('ccnx') |
Alexander Afanasyev | 3320698 | 2013-01-09 16:29:29 -0800 | [diff] [blame] | 100 | |
| 101 | conf.load('protoc') |
Alexander Afanasyev | 3320698 | 2013-01-09 16:29:29 -0800 | [diff] [blame] | 102 | |
| 103 | conf.load('qt4') |
| 104 | |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 105 | conf.load('boost') |
| 106 | |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 107 | conf.check_boost(lib='system test iostreams filesystem regex thread date_time') |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 108 | |
Alexander Afanasyev | 71b43e7 | 2012-12-27 01:03:43 -0800 | [diff] [blame] | 109 | boost_version = conf.env.BOOST_VERSION.split('_') |
| 110 | if int(boost_version[0]) < 1 or int(boost_version[1]) < 46: |
| 111 | Logs.error ("Minumum required boost version is 1.46") |
| 112 | return |
| 113 | |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 114 | conf.check_ccnx (path=conf.options.ccnx_dir) |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 115 | conf.define ('CCNX_PATH', conf.env.CCNX_ROOT) |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 116 | |
| 117 | if conf.options.debug: |
| 118 | conf.define ('_DEBUG', 1) |
Alexander Afanasyev | aa25b01 | 2013-02-27 12:00:30 -0800 | [diff] [blame] | 119 | conf.env.append_value('CXXFLAGS', ['-O0', '-Wall', '-Wno-unused-variable', '-Wno-unused-private-field', '-g3']) |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 120 | else: |
Alexander Afanasyev | d724581 | 2013-02-13 21:06:57 -0800 | [diff] [blame] | 121 | conf.env.append_value('CXXFLAGS', ['-O3', '-g']) |
| 122 | |
| 123 | if conf.env["CXX"] == ["clang++"]: |
| 124 | conf.env.append_value('CXXFLAGS', ['-fcolor-diagnostics', '-Qunused-arguments']) |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 125 | |
| 126 | if conf.options._test: |
Alexander Afanasyev | 9e5a470 | 2013-01-24 13:15:23 -0800 | [diff] [blame] | 127 | conf.define ('_TESTS', 1) |
Alexander Afanasyev | 72ac219 | 2013-01-03 19:33:43 -0800 | [diff] [blame] | 128 | conf.env.TEST = 1 |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 129 | |
Alexander Afanasyev | 71b43e7 | 2012-12-27 01:03:43 -0800 | [diff] [blame] | 130 | conf.write_config_header('src/config.h') |
| 131 | |
Zhenkai Zhu | 6b53f93 | 2013-03-02 20:46:02 -0800 | [diff] [blame^] | 132 | def update_html_qrc(bld): |
| 133 | import os |
| 134 | from tempfile import NamedTemporaryFile |
| 135 | from waflib import Logs |
| 136 | try: |
| 137 | Logs.pprint('BLUE', '[Pre-build] Generating gui/html.qrc') |
| 138 | if os.path.exists('gui/html'): |
| 139 | tf = NamedTemporaryFile(delete=False) |
| 140 | tf.write('<RCC><qresource prefix="/">\n') |
| 141 | for root, dirs, files in os.walk('gui/html'): |
| 142 | # get rid of 'gui' at the beginning for each root |
| 143 | path = '/'.join(root.split('/')[1:]) |
| 144 | for filename in files: |
| 145 | tf.write('\t<file>{0}/{1}</file>\n'.format(path, filename)) |
| 146 | |
| 147 | tf.write('</qresource></RCC>') |
| 148 | tf.close() |
| 149 | os.rename(tf.name, 'gui/html.qrc') |
| 150 | |
| 151 | else: |
| 152 | bld.fatal('Can not find html directory: gui/html does not exist') |
| 153 | except os.error as e: |
| 154 | bld.fatal('Os exception! Errno: {0}, Error: {1}'.format(e.errno(), e.strerror())) |
| 155 | |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 156 | def build (bld): |
Zhenkai Zhu | 6b53f93 | 2013-03-02 20:46:02 -0800 | [diff] [blame^] | 157 | bld.add_pre_fun(update_html_qrc) |
| 158 | |
Zhenkai Zhu | e840942 | 2013-01-28 12:52:17 -0800 | [diff] [blame] | 159 | executor = bld.objects ( |
| 160 | target = "executor", |
| 161 | features = ["cxx"], |
| 162 | source = bld.path.ant_glob(['executor/**/*.cc']), |
| 163 | use = 'BOOST BOOST_THREAD LIBEVENT LIBEVENT_PTHREADS LOG4CXX', |
| 164 | includes = "executor src", |
| 165 | ) |
| 166 | |
Alexander Afanasyev | 3f101ec | 2013-01-17 16:58:03 -0800 | [diff] [blame] | 167 | scheduler = bld.objects ( |
| 168 | target = "scheduler", |
Alexander Afanasyev | 68f2a95 | 2013-01-08 14:34:16 -0800 | [diff] [blame] | 169 | features = ["cxx"], |
Alexander Afanasyev | 3f101ec | 2013-01-17 16:58:03 -0800 | [diff] [blame] | 170 | source = bld.path.ant_glob(['scheduler/**/*.cc']), |
Zhenkai Zhu | e840942 | 2013-01-28 12:52:17 -0800 | [diff] [blame] | 171 | use = 'BOOST BOOST_THREAD LIBEVENT LIBEVENT_PTHREADS LOG4CXX executor', |
Zhenkai Zhu | 1888f74 | 2013-01-28 12:47:33 -0800 | [diff] [blame] | 172 | includes = "scheduler executor src", |
Alexander Afanasyev | 68f2a95 | 2013-01-08 14:34:16 -0800 | [diff] [blame] | 173 | ) |
| 174 | |
Zhenkai Zhu | a7e3da7 | 2012-12-27 13:45:00 -0800 | [diff] [blame] | 175 | libccnx = bld ( |
Alexander Afanasyev | 3f101ec | 2013-01-17 16:58:03 -0800 | [diff] [blame] | 176 | target="ccnx", |
| 177 | features=['cxx'], |
| 178 | source = bld.path.ant_glob(['ccnx/**/*.cc', 'ccnx/**/*.cpp']), |
Zhenkai Zhu | e840942 | 2013-01-28 12:52:17 -0800 | [diff] [blame] | 179 | use = 'BOOST BOOST_THREAD SSL CCNX LOG4CXX scheduler executor', |
Zhenkai Zhu | 1888f74 | 2013-01-28 12:47:33 -0800 | [diff] [blame] | 180 | includes = "ccnx src scheduler executor", |
Alexander Afanasyev | f289063 | 2013-01-02 13:40:02 -0800 | [diff] [blame] | 181 | ) |
| 182 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 183 | adhoc = bld ( |
| 184 | target = "adhoc", |
| 185 | features=['cxx'], |
| 186 | includes = "ccnx src", |
| 187 | ) |
| 188 | if Utils.unversioned_sys_platform () == "darwin": |
| 189 | adhoc.mac_app = True |
| 190 | adhoc.source = 'adhoc/adhoc-osx.mm' |
Alexander Afanasyev | e33846d | 2013-02-25 15:26:08 -0800 | [diff] [blame] | 191 | adhoc.use = "LOG4CXX OSX_FOUNDATION OSX_COREWLAN" |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 192 | |
Alexander Afanasyev | 3f101ec | 2013-01-17 16:58:03 -0800 | [diff] [blame] | 193 | chornoshare = bld ( |
| 194 | target="chronoshare", |
| 195 | features=['cxx'], |
| 196 | source = bld.path.ant_glob(['src/**/*.cc', 'src/**/*.cpp', 'src/**/*.proto']), |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 197 | use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 LOG4CXX scheduler ccnx", |
Zhenkai Zhu | 1888f74 | 2013-01-28 12:47:33 -0800 | [diff] [blame] | 198 | includes = "ccnx scheduler src executor", |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 199 | ) |
Alexander Afanasyev | b2fe74e | 2013-01-20 16:06:43 -0800 | [diff] [blame] | 200 | |
Zhenkai Zhu | 369eff1 | 2013-02-05 15:43:49 -0800 | [diff] [blame] | 201 | fs_watcher = bld ( |
| 202 | target = "fs_watcher", |
| 203 | features = "qt4 cxx", |
| 204 | defines = "WAF", |
| 205 | source = bld.path.ant_glob(['fs-watcher/*.cc']), |
| 206 | use = "SQLITE3 LOG4CXX scheduler executor QTCORE", |
| 207 | includes = "fs-watcher scheduler executor src", |
| 208 | ) |
| 209 | |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 210 | # Unit tests |
| 211 | if bld.env['TEST']: |
| 212 | unittests = bld.program ( |
| 213 | target="unit-tests", |
Zhenkai Zhu | d175627 | 2013-02-01 17:02:18 -0800 | [diff] [blame] | 214 | features = "qt4 cxx cxxprogram", |
| 215 | defines = "WAF", |
Zhenkai Zhu | 369eff1 | 2013-02-05 15:43:49 -0800 | [diff] [blame] | 216 | source = bld.path.ant_glob(['test/*.cc']), |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 217 | use = 'BOOST_TEST BOOST_FILESYSTEM BOOST_DATE_TIME LOG4CXX SQLITE3 QTCORE QTGUI ccnx database fs_watcher chronoshare', |
Zhenkai Zhu | 369eff1 | 2013-02-05 15:43:49 -0800 | [diff] [blame] | 218 | includes = "ccnx scheduler src executor gui fs-watcher", |
Alexander Afanasyev | 4f62f44 | 2013-02-07 22:36:08 -0800 | [diff] [blame] | 219 | install_prefix = None, |
Alexander Afanasyev | ee7e613 | 2013-01-03 20:03:14 -0800 | [diff] [blame] | 220 | ) |
Alexander Afanasyev | f289063 | 2013-01-02 13:40:02 -0800 | [diff] [blame] | 221 | |
Zhenkai Zhu | a9a7e1d | 2013-02-25 18:29:07 -0800 | [diff] [blame] | 222 | http_server = bld ( |
| 223 | target = "http_server", |
Zhenkai Zhu | d942922 | 2013-02-25 22:34:09 -0800 | [diff] [blame] | 224 | features = "qt4 cxx", |
Zhenkai Zhu | a9a7e1d | 2013-02-25 18:29:07 -0800 | [diff] [blame] | 225 | source = bld.path.ant_glob(['server/*.cpp']), |
Zhenkai Zhu | d942922 | 2013-02-25 22:34:09 -0800 | [diff] [blame] | 226 | includes = "server src .", |
| 227 | use = "BOOST QTCORE" |
Zhenkai Zhu | a9a7e1d | 2013-02-25 18:29:07 -0800 | [diff] [blame] | 228 | ) |
| 229 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 230 | qt = bld ( |
| 231 | target = "ChronoShare", |
| 232 | features = "qt4 cxx cxxprogram", |
| 233 | defines = "WAF", |
Zhenkai Zhu | 6b53f93 | 2013-03-02 20:46:02 -0800 | [diff] [blame^] | 234 | source = bld.path.ant_glob(['gui/*.cpp', 'gui/*.cc', 'gui/images.qrc', 'gui/html.qrc']), |
Zhenkai Zhu | d942922 | 2013-02-25 22:34:09 -0800 | [diff] [blame] | 235 | includes = "ccnx scheduler executor fs-watcher gui src adhoc server . ", |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 236 | use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE QTGUI LOG4CXX fs_watcher ccnx database chronoshare http_server" |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 237 | ) |
| 238 | |
| 239 | if Utils.unversioned_sys_platform () == "darwin": |
| 240 | app_plist = '''<?xml version="1.0" encoding="UTF-8"?> |
Alexander Afanasyev | 83a5300 | 2013-01-24 11:12:01 -0800 | [diff] [blame] | 241 | <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> |
| 242 | <plist version="0.9"> |
| 243 | <dict> |
| 244 | <key>CFBundlePackageType</key> |
| 245 | <string>APPL</string> |
| 246 | <key>CFBundleGetInfoString</key> |
| 247 | <string>Created by Waf</string> |
Zhenkai Zhu | 3857d71 | 2013-02-27 22:51:25 -0800 | [diff] [blame] | 248 | <key>CFBundleIdentifier</key> |
| 249 | <string>edu.ucla.cs.irl.Chronoshare</string> |
Alexander Afanasyev | 83a5300 | 2013-01-24 11:12:01 -0800 | [diff] [blame] | 250 | <key>CFBundleSignature</key> |
| 251 | <string>????</string> |
| 252 | <key>NOTE</key> |
| 253 | <string>THIS IS A GENERATED FILE, DO NOT MODIFY</string> |
| 254 | <key>CFBundleExecutable</key> |
| 255 | <string>%s</string> |
| 256 | <key>LSUIElement</key> |
| 257 | <string>1</string> |
Zhenkai Zhu | 8e3e907 | 2013-02-28 15:40:51 -0800 | [diff] [blame] | 258 | <key>SUPublicDSAKeyFile</key> |
| 259 | <string>dsa_pub.pem</string> |
Alexander Afanasyev | 83a5300 | 2013-01-24 11:12:01 -0800 | [diff] [blame] | 260 | </dict> |
| 261 | </plist>''' |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 262 | qt.mac_app = "ChronoShare.app" |
| 263 | qt.mac_plist = app_plist % "ChronoShare" |
| 264 | qt.use += " OSX_FOUNDATION OSX_COREWLAN adhoc" |
Alexander Afanasyev | 83a5300 | 2013-01-24 11:12:01 -0800 | [diff] [blame] | 265 | |
Alexander Afanasyev | 5a95a25 | 2013-02-25 12:55:48 -0800 | [diff] [blame] | 266 | if bld.env['HAVE_SPARKLE']: |
| 267 | qt.use += " OSX_SPARKLE" |
| 268 | qt.source += ["osx/auto-update/sparkle-auto-update.mm"] |
| 269 | qt.includes += " osx/auto-update" |
Alexander Afanasyev | 7c85d57 | 2013-02-26 22:06:54 -0800 | [diff] [blame] | 270 | if bld.env['HAVE_LOCAL_SPARKLE']: |
| 271 | qt.mac_frameworks = "osx/Frameworks/Sparkle.framework" |
Alexander Afanasyev | 548d38d | 2013-01-26 16:36:06 -0800 | [diff] [blame] | 272 | |
| 273 | cmdline = bld ( |
| 274 | target = "csd", |
| 275 | features = "qt4 cxx cxxprogram", |
| 276 | defines = "WAF", |
Zhenkai Zhu | 369eff1 | 2013-02-05 15:43:49 -0800 | [diff] [blame] | 277 | source = "cmd/csd.cc", |
| 278 | includes = "ccnx scheduler executor gui fs-watcher src . ", |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 279 | use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE QTGUI LOG4CXX fs_watcher ccnx database chronoshare" |
Alexander Afanasyev | 548d38d | 2013-01-26 16:36:06 -0800 | [diff] [blame] | 280 | ) |
| 281 | |
Alexander Afanasyev | eb575e0 | 2013-01-26 17:14:51 -0800 | [diff] [blame] | 282 | dump_db = bld ( |
| 283 | target = "dump-db", |
| 284 | features = "cxx cxxprogram", |
| 285 | source = "cmd/dump-db.cc", |
Zhenkai Zhu | 369eff1 | 2013-02-05 15:43:49 -0800 | [diff] [blame] | 286 | includes = "ccnx scheduler executor gui fs-watcher src . ", |
Alexander Afanasyev | e1c9504 | 2013-02-27 01:02:36 -0800 | [diff] [blame] | 287 | use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE LOG4CXX fs_watcher ccnx database chronoshare" |
Alexander Afanasyev | eb575e0 | 2013-01-26 17:14:51 -0800 | [diff] [blame] | 288 | ) |
| 289 | |
Alexander Afanasyev | a98e69c | 2013-02-24 15:42:45 -0800 | [diff] [blame] | 290 | from waflib import TaskGen |
| 291 | @TaskGen.extension('.mm') |
| 292 | def m_hook(self, node): |
| 293 | """Alias .mm files to be compiled the same as .cc files, gcc/clang will do the right thing.""" |
| 294 | return self.create_compiled_task('cxx', node) |
Zhenkai Zhu | 6b53f93 | 2013-03-02 20:46:02 -0800 | [diff] [blame^] | 295 | |
| 296 | #from waflib.TaskGen import extension |
| 297 | #from waflib.Task import Task |
| 298 | #class RecursiveQrcTask(Task): |
| 299 | # def run(self): |
| 300 | # print "inside RecursiveQrcTask: %s" % self.inputs |
| 301 | # |
| 302 | #@extension('.qrc') |
| 303 | #def rec_qrc(self, node): |
| 304 | # print "inside rec_qc: %s" % node |
| 305 | # return self.create_task('RecursiveQrcTask', node) |
| 306 | |