The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
8 years ago
|
project('qt4 and 5 build test', 'cpp')
|
||
12 years ago
|
|
||
8 years ago
|
foreach qt : ['qt4', 'qt5']
|
||
|
qtdep = dependency(qt, modules : ['Core', 'Gui', 'Widgets'], required : qt == 'qt5')
|
||
|
if qtdep.found()
|
||
|
qtmodule = import(qt)
|
||
12 years ago
|
|
||
8 years ago
|
# The following has two resource files because having two in one target
|
||
|
# requires you to do it properly or you get linker symbol clashes.
|
||
9 years ago
|
|
||
8 years ago
|
prep = qtmodule.preprocess(
|
||
|
moc_headers : ['mainWindow.h'], # These need to be fed through the moc tool before use.
|
||
|
ui_files : 'mainWindow.ui', # XML files that need to be compiled with the uic tol.
|
||
|
qresources : ['stuff.qrc', 'stuff2.qrc'], # Resource file for rcc compiler.
|
||
|
)
|
||
10 years ago
|
|
||
8 years ago
|
qexe = executable(qt + 'app',
|
||
|
sources : ['main.cpp', 'mainWindow.cpp', # Sources that don't need preprocessing.
|
||
|
prep],
|
||
|
dependencies : qtdep)
|
||
12 years ago
|
|
||
8 years ago
|
# We need a console test application because some test environments
|
||
|
# do not have an X server.
|
||
11 years ago
|
|
||
8 years ago
|
qtcore = dependency(qt, modules : 'Core')
|
||
11 years ago
|
|
||
8 years ago
|
qtcoreapp = executable(qt + 'core', 'q5core.cpp',
|
||
|
dependencies : qtcore)
|
||
11 years ago
|
|
||
8 years ago
|
test(qt + 'test', qtcoreapp)
|
||
11 years ago
|
|
||
8 years ago
|
# The build system needs to include the cpp files from
|
||
|
# headers but the user must manually include moc
|
||
|
# files from sources.
|
||
|
manpreprocessed = qtmodule.preprocess(
|
||
|
moc_sources : 'manualinclude.cpp',
|
||
|
moc_headers : 'manualinclude.h')
|
||
10 years ago
|
|
||
8 years ago
|
qtmaninclude = executable(qt + 'maninclude',
|
||
|
sources : ['manualinclude.cpp', manpreprocessed],
|
||
|
dependencies : qtcore)
|
||
11 years ago
|
|
||
8 years ago
|
test(qt + 'maninclude', qtmaninclude)
|
||
|
endif
|
||
|
endforeach
|