* wrong test_sector criterium
[hkl.git] / wscript
blobce68ec5bbb6f3783c7c0da505435874c065a3dc3
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2006-2008 (ita)
5 import UnitTest, os, Build, Options
7 # the following two variables are used by the target "waf dist"
8 VERSION='3.0.0-rc1'
9 APPNAME='hkl'
11 # these variables are mandatory ('/' are converted automatically)
12 srcdir = '.'
13 blddir = 'build'
15 def set_options(opt):
16 opt.tool_options('compiler_cc')
17 opt.tool_options('misc')
18 opt.add_option('--soleil', action='store_true', default=False, help='Build for the Soleil site')
20 def configure(conf):
21 conf.check_tool('compiler_cc')
22 conf.check_tool('misc')
23 if Options.options.soleil:
24 conf.env['LIB_GSL'] = ['GSL', 'GSLcblas', 'm']
25 conf.env['LIBPATH_GSL'] = '${SOLEIL_ROOT}/sw-support/GSL/lib'
26 conf.env['CPPPATH_GSL'] = '${SOLEIL_ROOT}/sw-support/GSL/include'
27 else:
28 conf.check_cfg(atleast_pkgconfig_version='0.0.0')
29 conf.check_cfg(package='gsl', args='--cflags --libs')
30 conf.env['HKL_VERSION'] = VERSION.split('-')[0]
32 def build(bld):
33 bld.add_subdirs('src test')
35 #install the headers
36 bld.install_files('${PREFIX}/include/hkl', 'include/hkl/*.h')
38 #create the pkg-config file hkl.pc.in -> hkl.pc
39 bld.new_task_gen(
40 features = 'subst',
41 source = 'hkl.pc.in',
42 target = 'hkl.pc',
43 dict = bld.env)
44 bld.install_files('${PREFIX}/lib/pkgconfig', 'hkl.pc')
48 def shutdown():
49 # hugly hack to let the check work
50 ld_library_path = Build.bld.bdir + '/default/src'
51 os.environ['LD_LIBRARY_PATH'] = ld_library_path
52 print ld_library_path
53 # Unit tests are run when "check" target is used
54 ut = UnitTest.unit_test()
55 ut.change_to_testfile_dir = True
56 ut.want_to_see_test_output = True
57 ut.want_to_see_test_error = True
58 ut.run()
59 ut.print_results()