meson/test cases/cmake/4 code gen/meson.build

21 lines
405 B
Meson
Raw Normal View History

2019-04-19 16:14:03 +08:00
project('cmake_code_gen', ['c', 'cpp'])
2019-02-23 19:18:33 +08:00
2019-05-28 22:57:10 +08:00
cm = import('cmake')
2019-02-23 19:18:33 +08:00
# Subproject with the "code generator"
2019-05-28 22:57:10 +08:00
sub_pro = cm.subproject('cmCodeGen')
sub_exe = sub_pro.target('genA')
2019-02-23 19:18:33 +08:00
# Generate the source
generated = custom_target(
'cmake-generated',
input: [],
output: ['test.cpp'],
command: [sub_exe, '@OUTPUT@']
)
# Build the exe
exe1 = executable('main1', ['main.cpp', generated])
2019-04-19 16:14:03 +08:00
test('test1', exe1)