diff --git a/waftools/rootsys.py b/waftools/rootsys.py index 7b4b244..21cff43 100644 --- a/waftools/rootsys.py +++ b/waftools/rootsys.py @@ -18,6 +18,9 @@ def check_root(cfg, mandatory=False): instdir = cfg.options.with_root if instdir and instdir.lower() in ['no','off','false']: + if mandatory: + raise RuntimeError("ROOT is mandatory but disabled via command line") + print ("optional ROOT dependency disabled by command line") return cfg.env.CXXFLAGS += ['-fPIC'] @@ -29,11 +32,10 @@ def check_root(cfg, mandatory=False): kwargs = dict(path_list=path_list) - cfg.find_program('root-config', var='ROOT-CONFIG', mandatory=mandatory, **kwargs) if not 'ROOT-CONFIG' in cfg.env: if mandatory: - raise RuntimeError("root-config not found but required") + raise RuntimeError("root-config not found but ROOT required") print ("skipping non mandatory ROOT, use --with-root to force") return diff --git a/wscript b/wscript index a9fe90e..7c0ec94 100644 --- a/wscript +++ b/wscript @@ -58,11 +58,13 @@ def configure(cfg): submodules.remove('dfp') # Remove WCT packages that happen to have same name as external name - for maybe in "root tbb cuda".split(): - have='have_%s'%maybe - if have.upper() not in cfg.env and maybe in submodules: - print ('Removing submodule "%s" due to lack of external dependency'%maybe) - submodules.remove(maybe) + for pkg,ext in dict(root="ROOTSYS", tbb="TBB", cuda="CUDA").items(): + have='HAVE_'+ext + if have in cfg.env: + continue + if pkg in submodules: + print ('Removing package "%s" due to lack of external dependency'%pkg) + submodules.remove(pkg) cfg.env.SUBDIRS = submodules print ('Configured for submodules: %s' % (', '.join(submodules), ))