-folder1_src = ['folder1.c']
+folder1_src = files(['folder1.c'])
folder1_inc = include_directories('.')
folder1_dep = declare_dependency(sources: folder1_src,
include_directories : folder1_inc)
-folder2_src = ['folder2.c']
+folder2_src = files(['folder2.c'])
folder2_inc = include_directories('.')
folder2_dep = declare_dependency(sources: folder2_src,
include_directories : folder2_inc,
project('meson_test','cpp', 'c')
gtest = dependency('gtest', main : true, required : false)
-
if not gtest.found()
gtest_sub = subproject('gtest')
- gtest_src = [gtest_sub.get_variable('gtest_libsources'),
- gtest_sub.get_variable('gtest_mainsources')]
+ gtest_src = [gtest_sub.get_variable('gtest_libsources'), gtest_sub.get_variable('gtest_mainsources')]
gtest_inc = gtest_sub.get_variable('gtest_incdir')
gtest_lib = static_library('gtest', sources: gtest_src,
include_directories: gtest_inc)
dependencies: dependency('threads'))
endif
-subdir('folder1')
-subdir('folder1_test')
-subdir('folder2')
-subdir('folder2_test')
+py3 = import('python3').find_python()
+ret = run_command(py3, '-c', 'import glob\ndirs = glob.glob("**/meson.build")\nfor d in sorted(dirs): print(d[:-12])')
+dirs = []
+if ret.returncode() == 0
+ dirs += ret.stdout().split()
+endif
+foreach d : dirs
+ subdir(d)
+endforeach