# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

from waflib import Utils

top = '..'

def configure(conf):
    conf.write_config_header('core/chronoshare-config.hpp')

def build(bld):
    
    #if bld.env['TESTS']:

        unit_test_base = bld(
            target='unit-tests-base',
            name='unit-tests-base',
            features='cxx',
            source=bld.path.ant_glob(['*.cpp'], excl='main.cpp'),
            use='core-objects BOOST_TEST BOOST_FILESYSTEM BOOST_DATE_TIME LOG4CXX SQLITE3 QTCORE QTGUI NDN_CXX database fs_watcher chronoshare TINYXML'
          )
        # unit test app
        bld(features='cxx qt4',
            target='unit-tests-main',
            name='unit-tests-main',
            source='main.cpp',
            use='core-objects BOOST_TEST BOOST_FILESYSTEM BOOST_DATE_TIME LOG4CXX SQLITE3 QTCORE QTGUI NDN_CXX database fs_watcher chronoshare TINYXML',
            defines=['BOOST_TEST_MODULE=CHRONOSHARE Unit Test'])

        unit_tests = bld.program(
                target='../unit-tests',
                features='qt4 cxx cxxprogram',
                source=bld.path.ant_glob(['disabled/*.cpp'], excl=['main.cpp']),
                use='unit-tests-base unit-tests-main core-objects BOOST_TEST BOOST_FILESYSTEM BOOST_DATE_TIME LOG4CXX SQLITE3 QTCORE QTGUI NDN_CXX database fs-watcher TINYXML',
                includes='core ../fs-watcher .',
                install_path=None,
                defines='UNIT_TEST_CONFIG_PATH=\"%s/tmp-files/\"' % (bld.bldnode)
              )