#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) # Creates a simple program with a custom compiler: # ih.coin -> ih.cpp -> ih.o # This file is not a module, and all the code # from it will be executed upon compile step # # This is really the content of a "def build(bld):" function definition # # By contrast, only functions can be defined in a wscript # # a program that links using the GLIB library, defined in the configuration # it also processes coin files, defined in the dang.py module (coin hook) bld( features = 'cxx cprogram', source = 'main.cpp ih.coin', includes = '. ..', defines = 'bidule=34', uselib = 'GLIB DEFTEST', target = 'testprogram2') # a shared library, with a version number -> libshlib1.so.4.2.1 bld( features = 'cc cshlib', source = 'stuff.c', includes='. ..', target='shlib1', vnum='4.2.1') ############################################# # just object files bld( features = 'cxx', source = 'f1.cpp f2.cpp', includes = '.', defines = 'DEBUG=1', target = 'gruik') # A program using the object files bld( features = 'cxx cprogram', source = 'm1.cpp', includes = '.', uselib = 'GL', target = 'm1', add_objects = 'gruik') # Another program using the same object files too bld( features = 'cxx cprogram', source = 'm2.cpp', includes = '.', target = 'm2', add_objects = 'gruik') # demonstrates how to produce a .desktop files from substitutions import misc bld( features = 'subst', source = 'foo.in', target = 'foo.desktop', dict = {'TEST': 'OK', 'not': 'used'}, fun = misc.subst_func, install_path = '${PREFIX}/test')