@@ -41,15 +41,28 @@ if (not root_dep.found()) and (not root_opt.disabled())
4141 # Probe root-config once
4242 rootcfg = find_program (' root-config' , required : false )
4343 if rootcfg.found()
44- root_prefix = run_command (rootcfg, ' --prefix' , check : true ).stdout().strip()
44+ # root_dep = dependency('ROOT',
45+ # version : '>=6.32.16',
46+ # method : 'cmake',
47+ # modules : ['ROOT::Core', 'ROOT::RIO', 'ROOT::Tree', 'ROOT::Hist'],
48+ # required : false,
49+ # include_type : 'system') # treat as system include paths - no warnings
50+
51+ root_prefix = run_command (rootcfg, ' --prefix' , check : true ).stdout().strip()
52+ root_libdir = run_command (rootcfg, ' --libdir' , check : true ).stdout().strip()
53+
54+ root_cmake = join_paths (root_libdir, ' cmake' , ' ROOT' )
55+ if not fs.is_dir(root_cmake)
56+ root_cmake = join_paths (root_prefix, ' lib' , ' cmake' , ' ROOT' )
57+ endif
4558
46- root_mods = []
4759 root_dep = dependency (' ROOT' ,
48- version : ' >=6.32.16' ,
49- method : ' cmake' ,
50- modules : [' ROOT::Core' , ' ROOT::RIO' , ' ROOT::Tree' , ' ROOT::Hist' ],
51- required : false ,
52- include_type : ' system' ) # treat as system include paths - no warnings
60+ version : ' >=6.32.16' ,
61+ method : ' cmake' ,
62+ modules : [' ROOT::Core' , ' ROOT::RIO' , ' ROOT::Tree' , ' ROOT::Hist' ],
63+ cmake_args : [' -DROOT_DIR=' + root_cmake],
64+ required : false ,
65+ include_type : ' system' )
5366
5467 if root_dep.found()
5568 message (' root-config found; ROOT dependency resolved: ' + root_dep.version())
0 commit comments