|
| 1 | +project( |
| 2 | + 'fftpack', |
| 3 | + 'fortran', |
| 4 | + version: '4.0.0', |
| 5 | + meson_version: '>=0.57', |
| 6 | + default_options: [ |
| 7 | + 'buildtype=debugoptimized', |
| 8 | + 'default_library=both', |
| 9 | + 'c_std=c11', |
| 10 | + ], |
| 11 | +) |
| 12 | + |
| 13 | +install = not (meson.is_subproject() and get_option('default_library') == 'static') |
| 14 | + |
| 15 | +# Collect source of the project |
| 16 | +srcs = [] |
| 17 | +subdir('src') |
| 18 | + |
| 19 | +# General configuration information |
| 20 | +inc_dirs = [] |
| 21 | +lib_deps = [] |
| 22 | +subdir('configure') |
| 23 | + |
| 24 | +# Library target |
| 25 | +fftpack_lib = library( |
| 26 | + meson.project_name(), |
| 27 | + sources: srcs, |
| 28 | + version: meson.project_version(), |
| 29 | + dependencies: lib_deps, |
| 30 | + include_directories: inc_dirs, |
| 31 | + install: install, |
| 32 | +) |
| 33 | + |
| 34 | +# Export dependency for other projects and test suite |
| 35 | +fftpack_dep = declare_dependency( |
| 36 | + link_with: fftpack_lib, |
| 37 | + dependencies: lib_deps, |
| 38 | + variables: {'includedir': meson.current_source_dir() / 'include'}, |
| 39 | +) |
| 40 | + |
| 41 | +# add the testsuite |
| 42 | +subdir('test') |
| 43 | + |
| 44 | +if install |
| 45 | + module_id = meson.project_name() / fc_id + '-' + fc.version() |
| 46 | + meson.add_install_script( |
| 47 | + find_program(files('configure'/'install-mod.py')), |
| 48 | + get_option('includedir') / module_id, |
| 49 | + ) |
| 50 | + |
| 51 | + pkg = import('pkgconfig') |
| 52 | + pkg.generate( |
| 53 | + fftpack_lib, |
| 54 | + description: 'fftpack', |
| 55 | + subdirs: ['', module_id], |
| 56 | + ) |
| 57 | +endif |
0 commit comments