meson.build
50 lines
| 2.1 KiB
| text/plain
|
TextLexer
r1480 | shiboken2 = find_program('shiboken2') | |||
qmake = find_program('qmake-qt5','qmake') | ||||
pymod = import('python') | ||||
r1488 | python3 = pymod.find_installation('python3', modules:['PySide2','shiboken2', 'shiboken2_generator', 'numpy']) | |||
python3_dep = python3.dependency() | ||||
numpy_inc = run_command(python3, '-c', 'import numpy;print(numpy.get_include())').stdout().strip('\n') | ||||
r1480 | ||||
qt5_modules = ['QtCore','QtGui','QtWidgets'] | ||||
qt_headers_path = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip('\n') | ||||
generated_srcs = run_command(python3, 'src_list.py', 'meson').stdout().split(';') | ||||
modules_arg = '--modules=@0@'.format(','.join(qt5_modules)) | ||||
shiboken2_build_flags = run_command(python3, 'shiboken-helper.py', '--includes', modules_arg).stdout().strip('\n').split(' ') | ||||
shiboken2_link_flags = run_command(python3, 'shiboken-helper.py', '--libs', modules_arg).stdout().strip('\n').split(' ') | ||||
shiboken2_typesystem = run_command(python3, 'shiboken-helper.py', '--typesystem').stdout().strip('\n') | ||||
sciqlop_bindings_incs = shiboken2_build_flags + [ | ||||
'-I'+meson.current_source_dir()+'/../../gui/include', | ||||
'-I'+meson.current_source_dir()+'/../../core/include', | ||||
r1482 | '-I'+meson.current_source_dir()+'/../../subprojects/TimeSeries/include', | |||
r1485 | '-I'+meson.current_source_dir()+'/../../subprojects/cpp_utils/include', | |||
r1480 | '-I'+python3.get_path('include'), | |||
r1488 | '-I'+qt_headers_path, | |||
'-I'+numpy_inc | ||||
r1480 | ] | |||
foreach mod:qt5_modules | ||||
sciqlop_bindings_incs += ['-I'+qt_headers_path+'/'+mod] | ||||
endforeach | ||||
sciqlop_bindings_src = files('bindings.h', 'PyDataProvider.h', 'numpy_wrappers.h', 'numpy_wrappers.cpp') | ||||
subdir('SciQLopBindings') | ||||
r1487 | subdir('plugins') | |||
r1480 | ||||
shiboken_dep = declare_dependency(compile_args: shiboken2_build_flags, link_args: shiboken2_link_flags) | ||||
sciqlop_bindings = python3.extension_module('SciQLopBindings',sciqlop_bindings_src,shiboken2_generator_out, | ||||
r1488 | dependencies : [sciqlop_app_dep, python3_dep, shiboken_dep, cpp_utils_dep], | |||
include_directories : numpy_inc | ||||
r1480 | ) | |||
configure_file(input:'main.py', output:'main.py', copy:true) | ||||
r1481 | ||||
executable('sciqlop', 'main.cpp', dependencies :python3.dependency()) | ||||