Changeset 6383ca4


Ignore:
Timestamp:
Dec 10, 2018, 7:02:18 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
Children:
00d6c85
Parents:
e45345d
Message:

[waf] update rules to build manual and api docs in build/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    re45345d r6383ca4  
    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        bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/api',
     559                bld.path.find_or_declare('api').ant_glob('**/*'),
     560                cwd=bld.path.find_or_declare('api'),
     561                relative_trick=True)
    559562
    560563def 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']:
     564    # build documentation from source files using sphinx-build
     565    try:
     566        import aubio
     567        has_aubio = True
     568    except ImportError:
     569        from waflib import Logs
     570        Logs.pprint('YELLOW', "Sphinx manual: install aubio first")
     571        has_aubio = False
     572    if bld.env['SPHINX'] and has_aubio:
    564573        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)
     574        rule = '${SPHINX} -b html -D release=${VERSION}' \
     575                ' -D version=${VERSION} -W -a -q' \
     576                ' -d %s ' % os.path.join(os.path.abspath(out), 'doctrees')
     577        rule += ' . %s' % os.path.join(os.path.abspath(out), 'manual')
     578        bld( name = 'sphinx', rule = rule,
     579                cwd = bld.path.find_dir('doc'),
     580                source = bld.path.find_dir('doc').ant_glob('*.rst'),
     581                target = bld.path.find_or_declare('manual/index.html'))
     582        bld.install_files('${DATAROOTDIR}/doc/libaubio-doc/manual',
     583                bld.path.find_or_declare('manual').ant_glob('**/*'),
     584                cwd=bld.path.find_or_declare('manual'),
     585                relative_trick=True)
    575586
    576587# register the previous rules as build rules
Note: See TracChangeset for help on using the changeset viewer.