-
Notifications
You must be signed in to change notification settings - Fork 2
/
find_eigen3.py
32 lines (27 loc) · 1.13 KB
/
find_eigen3.py
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
import os.path as osp
from waflib.Configure import conf
def options(opt):
opt = opt.add_option_group('Eigen Options')
opt.add_option('--with-eigen', type='string',
help="give Eigen3 installation location")
pass
@conf
def check_eigen(ctx, mandatory=True):
instdir = ctx.options.with_eigen
if instdir is None or instdir.lower() in ['yes','true','on']:
ctx.start_msg('Checking for Eigen in PKG_CONFIG_PATH')
# note: Eigen puts its eigen3.pc file under share as there is
# no lib. Be sure your PKG_CONFIG_PATH reflects this.
ctx.check_cfg(package='eigen3', uselib_store='EIGEN', args='--cflags --libs', mandatory=mandatory)
elif instdir.lower() in ['no','off','false']:
return
else:
ctx.start_msg('Checking for Eigen in %s' % instdir)
ctx.env.INCLUDES_EIGEN = [ osp.join(instdir,'include/eigen3') ]
ctx.check(header_name="Eigen/Dense", use='EIGEN', mandatory=mandatory)
if len(ctx.env.INCLUDES_EIGEN):
ctx.end_msg(ctx.env.INCLUDES_EIGEN[0])
else:
ctx.end_msg('Eigen3 not found')
def configure(cfg):
cfg.check_eigen()