Installing filesTo 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- The first argument represents the destination
- It may contain variables (in the examples above: PREFIX) which are substitued from bld.env.
- The files are searched from the current directory (directory of the wscript file)
- The file copy does not occur if the destination file is more recent than the source file (timestamps)
- The DESTDIR environment variable is silently honored for packaging
- An optional attribute chmod specifies the permissions (eg: 0755)
- An environment may be given as an optional attribute
Installing task generator resultsPrograms 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 permissionsTask generators have a chmod class member: obj.chmod = 0755
|
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:
I don't understand what 'inst_var' does, but specifying
does prevent installation.
and waf 1.3.1 uses also another method for this (according to demos/adv/src/wscript_build:):
and specifying
does prevent installation.