Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r9ffa590 r2d64a24  
    547547    if bld.env['DOXYGEN']:
    548548        bld.env.VERSION = VERSION
    549         rule = '( cat ${SRC} && echo PROJECT_NUMBER=${VERSION}; )'
     549        rule = '( cat ${SRC[0]} && echo PROJECT_NUMBER=${VERSION}'
     550        rule += ' && echo OUTPUT_DIRECTORY=%s && echo HTML_OUTPUT=%s )'
    550551        rule += ' | doxygen - > /dev/null'
     552        rule %= (os.path.abspath(out), 'api')
    551553        bld( name = 'doxygen', rule = rule,
    552                 source = 'doc/web.cfg',
    553                 target = '../doc/web/html/index.html',
    554                 cwd = 'doc')
    555         bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc',
    556                 bld.path.ant_glob('doc/web/html/**'),
    557                 cwd = bld.path.find_dir ('doc/web'),
    558                 relative_trick = True)
     554                source = ['doc/web.cfg']
     555                    + bld.path.find_dir('src').ant_glob('**/*.h'),
     556                target = bld.path.find_or_declare('api/index.html'),
     557                cwd = bld.path.find_dir('doc'))
     558        # evaluate nodes lazily to prevent build directory traversal warnings
     559        bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/api',
     560                bld.path.find_or_declare('api').ant_glob('**/*',
     561                    generator=True), cwd=bld.path.find_or_declare('api'),
     562                relative_trick=True)
    559563
    560564def sphinx(bld):
    561     # build documentation from source files using sphinx-build note: build in
    562     # ../doc/_build/html, otherwise waf wont install unsigned files
    563     if bld.env['SPHINX']:
     565    # build documentation from source files using sphinx-build
     566    try:
     567        import aubio
     568        has_aubio = True
     569    except ImportError:
     570        from waflib import Logs
     571        Logs.pprint('YELLOW', "Sphinx manual: install aubio first")
     572        has_aubio = False
     573    if bld.env['SPHINX'] and has_aubio:
    564574        bld.env.VERSION = VERSION
    565         bld( name = 'sphinx',
    566                 rule = '${SPHINX} -b html -D release=${VERSION}' \
    567                         ' -D version=${VERSION} -a -q' \
    568                         ' `dirname ${SRC}` `dirname ${TGT}`',
    569                 source = 'doc/conf.py',
    570                 target = '../doc/_build/html/index.html')
    571         bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx',
    572                 bld.path.ant_glob('doc/_build/html/**'),
    573                 cwd = bld.path.find_dir('doc/_build/html'),
    574                 relative_trick = True)
     575        rule = '${SPHINX} -b html -D release=${VERSION}' \
     576                ' -D version=${VERSION} -W -a -q' \
     577                ' -d %s ' % os.path.join(os.path.abspath(out), 'doctrees')
     578        rule += ' . %s' % os.path.join(os.path.abspath(out), 'manual')
     579        bld( name = 'sphinx', rule = rule,
     580                cwd = bld.path.find_dir('doc'),
     581                source = bld.path.find_dir('doc').ant_glob('*.rst'),
     582                target = bld.path.find_or_declare('manual/index.html'))
     583        # evaluate nodes lazily to prevent build directory traversal warnings
     584        bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/manual',
     585                bld.path.find_or_declare('manual').ant_glob('**/*',
     586                    generator=True), cwd=bld.path.find_or_declare('manual'),
     587                relative_trick=True)
    575588
    576589# register the previous rules as build rules
Note: See TracChangeset for help on using the changeset viewer.