My favorites | Sign in
Logo
waf
                
Search
for
Updated Nov 12, 2008 by tnagy1024
InstallFiles  
Installing files like pictures or headers or results of the builds

Installing files

To install a few headers, the method install_files can be used:

bld.install_files('${PREFIX}/include', 'test.h')

It is also possible to give several files to install at once:

bld.install_files('${PREFIX}/include', 'foo1.h foo2.h foo3.h')

To trigger globs, use a star in the name, like this:

bld.install_files('${PREFIX}/include', 'src/*.h')

The method install_as is similar to install_files, it is used to install a single file under a different name:

bld.install_as('${PREFIX}/dir/bar.png', 'foo.png')

Details

Installing task generator results

Programs and libraries usually install automatically under $PREFIX/bin or $PREFIX/lib

    obj = bld.create_obj('cpp', 'program')
    obj.source = "a1.cpp"
    obj.target = "testprog"

The installation path may be overridden by the parameter install_path:

    obj.install_path = '${LIBDIR}'

if set to None the installation will be prevented.

Setting permissions

Task generators have a chmod class member:

    obj.chmod = 0755

Comment by mchapman87501, Mar 12, 2008

The section on overriding the PREFIX variable seems to be out of date. waf 1.3.3 from the subversion repository includes this example, from demos/adv/src/wscript_build:

obj.inst_var    = 'PREFIX'
obj.inst_dir = 'test'

I don't understand what 'inst_var' does, but specifying

obj.inst_var = 0

does prevent installation.

Comment by mydexterid, Apr 16, 2008

and waf 1.3.1 uses also another method for this (according to demos/adv/src/wscript_build:):

obj.install_var    = 'PREFIX'
obj.install_subdir = 'test'

and specifying

obj.install_var    = 0

does prevent installation.


Sign in to add a comment
Hosted by Google Code