-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
55 lines (45 loc) · 1.54 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
project('libct', ['c', 'cpp'], version: '0.1.0', default_options: ['cpp_std=c++17'])
pymod = import('python')
python3 = pymod.find_installation('python3')
gurobi = dependency('gurobi_c++', fallback: ['gurobi-finder', 'gurobi'])
swig = find_program('swig', required: true)
swig_include_dir = meson.source_root() / 'include'
include_dir = include_directories('include')
libct_static = static_library(
'ct', 'lib/ct.cpp',
include_directories: include_dir,
dependencies: [gurobi],
install: true)
libct_shared = shared_library(
'ct', 'lib/ct.cpp',
include_directories: include_dir,
version: meson.project_version(),
soversion: '0',
dependencies: [gurobi],
install: true)
libct_py = custom_target('libct_py',
input: ['swig/ct.i', 'include/ct.h'],
output: ['libct_py.c'],
command: [swig, '-python', '-noproxy', '-I@0@'.format(swig_include_dir), '-o', '@OUTPUT@', '@INPUT0@'])
python3.extension_module('libct',
sources: [libct_py],
include_directories: include_dir,
link_with: [libct_static],
dependencies: [python3.dependency()],
install: true,
install_dir: python3.get_install_dir(pure: false, subdir: 'ct'))
python3.install_sources([
'python/ct/__init__.py',
'python/ct/gurobi.py',
'python/ct/model.py',
'python/ct/primals.py',
'python/ct/rounding.py',
'python/ct/tracker.py',
'python/ct/txt.py',
'python/ct/utils.py'
], pure: true, subdir: 'ct')
install_data(['bin/ct'],
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x')
install_headers('include/ct.h')
# vim: set ts=8 sts=2 sw=2 et: