@@ -0,0 +1,17 | |||
|
1 | ||
|
2 | shiboken2_generator_out = custom_target('sciqlop_bindings', | |
|
3 | build_by_default:true, | |
|
4 | output:generated_srcs, | |
|
5 | input:'../bindings.xml', | |
|
6 | depend_files:sciqlop_bindings_src, | |
|
7 | command:[shiboken2,meson.current_source_dir()+'/../bindings.h',meson.current_source_dir()+'/../bindings.xml','--generator-set=shiboken', | |
|
8 | '--enable-parent-ctor-heuristic', | |
|
9 | '--enable-return-value-heuristic', | |
|
10 | '--use-isnull-as-nb_nonzero', | |
|
11 | '--avoid-protected-hack', | |
|
12 | '--enable-pyside-extensions', | |
|
13 | '-std=c++17', | |
|
14 | '--typesystem-paths='+shiboken2_typesystem, | |
|
15 | sciqlop_bindings_incs, | |
|
16 | '--output-directory='+meson.current_build_dir()+'/../'] | |
|
17 | ) |
@@ -0,0 +1,43 | |||
|
1 | shiboken2 = find_program('shiboken2') | |
|
2 | qmake = find_program('qmake-qt5','qmake') | |
|
3 | ||
|
4 | pymod = import('python') | |
|
5 | python3 = pymod.find_installation('python3', modules:['PySide2','shiboken2', 'shiboken2_generator']) | |
|
6 | ||
|
7 | qt5_modules = ['QtCore','QtGui','QtWidgets'] | |
|
8 | ||
|
9 | qt_headers_path = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip('\n') | |
|
10 | generated_srcs = run_command(python3, 'src_list.py', 'meson').stdout().split(';') | |
|
11 | ||
|
12 | modules_arg = '--modules=@0@'.format(','.join(qt5_modules)) | |
|
13 | ||
|
14 | shiboken2_build_flags = run_command(python3, 'shiboken-helper.py', '--includes', modules_arg).stdout().strip('\n').split(' ') | |
|
15 | shiboken2_link_flags = run_command(python3, 'shiboken-helper.py', '--libs', modules_arg).stdout().strip('\n').split(' ') | |
|
16 | shiboken2_typesystem = run_command(python3, 'shiboken-helper.py', '--typesystem').stdout().strip('\n') | |
|
17 | ||
|
18 | sciqlop_bindings_incs = shiboken2_build_flags + [ | |
|
19 | '-I'+meson.current_source_dir()+'/../../gui/include', | |
|
20 | '-I'+meson.current_source_dir()+'/../../core/include', | |
|
21 | '-I'+meson.current_source_dir()+'/../../core/external/TimeSeries/include', | |
|
22 | '-I'+python3.get_path('include'), | |
|
23 | '-I'+qt_headers_path | |
|
24 | ] | |
|
25 | ||
|
26 | foreach mod:qt5_modules | |
|
27 | sciqlop_bindings_incs += ['-I'+qt_headers_path+'/'+mod] | |
|
28 | endforeach | |
|
29 | ||
|
30 | ||
|
31 | sciqlop_bindings_src = files('bindings.h', 'PyDataProvider.h', 'numpy_wrappers.h', 'numpy_wrappers.cpp') | |
|
32 | ||
|
33 | subdir('SciQLopBindings') | |
|
34 | ||
|
35 | shiboken_dep = declare_dependency(compile_args: shiboken2_build_flags, link_args: shiboken2_link_flags) | |
|
36 | ||
|
37 | sciqlop_bindings = python3.extension_module('SciQLopBindings',sciqlop_bindings_src,shiboken2_generator_out, | |
|
38 | dependencies : [sciqlop_app_dep, python3.dependency(), shiboken_dep], | |
|
39 | ) | |
|
40 | ||
|
41 | ||
|
42 | configure_file(input:'main.py', output:'main.py', copy:true) | |
|
43 | configure_file(input:'TestPlugin.py', output:'TestPlugin.py', copy:true) |
@@ -0,0 +1,46 | |||
|
1 | #!/bin/env python3 | |
|
2 | ||
|
3 | import os | |
|
4 | import sys | |
|
5 | import importlib | |
|
6 | import argparse | |
|
7 | from glob import glob | |
|
8 | ||
|
9 | ||
|
10 | shiboken2_generator = importlib.import_module('shiboken2_generator') | |
|
11 | shiboken2 = importlib.import_module('shiboken2') | |
|
12 | PySide2 = importlib.import_module('PySide2') | |
|
13 | ||
|
14 | ||
|
15 | parser = argparse.ArgumentParser(description='PySide2/shiboken2 ') | |
|
16 | group = parser.add_mutually_exclusive_group() | |
|
17 | group.add_argument('--libs',action='store_true') | |
|
18 | group.add_argument('--includes',action='store_true') | |
|
19 | parser.add_argument('--modules') | |
|
20 | group.add_argument('--typesystem', action='store_true') | |
|
21 | args = parser.parse_args() | |
|
22 | ||
|
23 | ||
|
24 | def first_existing_path(path_list): | |
|
25 | return next((path for path in path_list if os.path.exists(path)), None) | |
|
26 | ||
|
27 | ||
|
28 | if shiboken2.__file__ and shiboken2_generator.__file__ and PySide2.__file__: | |
|
29 | PySide2_inc = first_existing_path([PySide2.__path__[0]+'/include','/usr/include/PySide2']) | |
|
30 | PySide2_typesys = first_existing_path([PySide2.__path__[0]+'/typesystems','/usr/share/PySide2/typesystems']) | |
|
31 | PySide2_includes = first_existing_path([PySide2.__path__[0]+'/include','/usr/include/PySide2']) | |
|
32 | shiboken2_includes = first_existing_path([shiboken2.__path__[0]+'/include','/usr/include/shiboken2']) | |
|
33 | ||
|
34 | if args.typesystem: | |
|
35 | print(PySide2_typesys) | |
|
36 | modules = args.modules.split(',') | |
|
37 | if args.libs: | |
|
38 | main_lib = (glob(shiboken2.__path__[0]+'/libshiboken2'+importlib.machinery.EXTENSION_SUFFIXES[0])+glob("/usr/lib64/"+'/libshiboken2'+importlib.machinery.EXTENSION_SUFFIXES[0]))[0] | |
|
39 | main_lib += " "+(glob(PySide2.__path__[0]+'/libpyside2'+importlib.machinery.EXTENSION_SUFFIXES[0])+glob("/usr/lib64/"+'/libpyside2'+importlib.machinery.EXTENSION_SUFFIXES[0]))[0] | |
|
40 | modules_libs = [importlib.import_module(f'PySide2.{module}').__file__ for module in modules] | |
|
41 | print(" ".join([main_lib]+ modules_libs)) | |
|
42 | if args.includes: | |
|
43 | modules_incs = [f"-I{PySide2_includes}/{module}" for module in modules] | |
|
44 | print(" ".join([f"-I{PySide2_includes} -I{shiboken2_includes}"]+ modules_incs)) | |
|
45 | ||
|
46 |
@@ -46,3 +46,21 sciqlop_app = executable('sciqlop', | |||
|
46 | 46 | dependencies : [sciqlop_gui, sciqlop_core], |
|
47 | 47 | install : true |
|
48 | 48 | ) |
|
49 | ||
|
50 | sciqlop_app_lib = library('sciqlop', | |
|
51 | app_sources, | |
|
52 | app_moc_files, | |
|
53 | rc, | |
|
54 | include_directories : [ app_inc], | |
|
55 | link_with: app_libs, | |
|
56 | cpp_args: cpp_args, | |
|
57 | dependencies : [sciqlop_gui, sciqlop_core], | |
|
58 | install : true | |
|
59 | ) | |
|
60 | ||
|
61 | sciqlop_app_dep = declare_dependency(link_with : sciqlop_app_lib, | |
|
62 | include_directories : app_inc, | |
|
63 | dependencies : [sciqlop_gui, sciqlop_core]) | |
|
64 | ||
|
65 | ||
|
66 | subdir('PySide2-bindings') |
@@ -1,4 +1,4 | |||
|
1 |
project('SciQLOP', 'cpp',default_options : ['cpp_std=c++17'], meson_version:'>=0. |
|
|
1 | project('SciQLOP', 'cpp',default_options : ['cpp_std=c++17'], meson_version:'>=0.51.0') | |
|
2 | 2 | add_global_arguments('-DSCIQLOP_VERSION="1.1.0"', language : 'cpp') |
|
3 | 3 | |
|
4 | 4 | qt5 = import('qt5') |
@@ -1,3 +1,3 | |||
|
1 | 1 | #subdir('mockplugin') |
|
2 | subdir('python_providers') | |
|
2 | #subdir('python_providers') | |
|
3 | 3 | #subdir('amda') |
@@ -1,10 +1,10 | |||
|
1 | 1 | [wrap-file] |
|
2 |
directory = googletest-release-1.8. |
|
|
2 | directory = googletest-release-1.8.1 | |
|
3 | 3 | |
|
4 |
source_url = https://github.com/google/googletest/archive/release-1.8. |
|
|
5 |
source_filename = gtest-1.8. |
|
|
6 | source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf | |
|
4 | source_url = https://github.com/google/googletest/archive/release-1.8.1.zip | |
|
5 | source_filename = gtest-1.8.1.zip | |
|
6 | source_hash = 927827c183d01734cc5cfef85e0ff3f5a92ffe6188e0d18e909c5efebf28a0c7 | |
|
7 | 7 | |
|
8 |
patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8. |
|
|
9 |
patch_filename = gtest-1.8. |
|
|
10 | patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5 | |
|
8 | patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.1/1/get_zip | |
|
9 | patch_filename = gtest-1.8.1-1-wrap.zip | |
|
10 | patch_hash = f79f5fd46e09507b3f2e09a51ea6eb20020effe543335f5aee59f30cc8d15805 |
@@ -1,10 +1,10 | |||
|
1 | 1 | [wrap-file] |
|
2 |
directory = pybind11-2. |
|
|
2 | directory = pybind11-2.3.0 | |
|
3 | 3 | |
|
4 |
source_url = https://github.com/pybind/pybind11/archive/v2. |
|
|
5 |
source_filename = pybind11-2. |
|
|
6 | source_hash = 20314968531faa4c8579da2c46c2ce13aecd68ae79b6dd8cf9b99698b2304348 | |
|
4 | source_url = https://github.com/pybind/pybind11/archive/v2.3.0.zip | |
|
5 | source_filename = pybind11-2.3.0.zip | |
|
6 | source_hash = 1f844c071d9d98f5bb08458f128baa0aa08a9e5939a6b42276adb1bacd8b483e | |
|
7 | 7 | |
|
8 |
patch_url = https://wrapdb.mesonbuild.com/v1/projects/pybind11/2. |
|
|
9 |
patch_filename = pybind11-2. |
|
|
10 | patch_hash = 18a273260a59368b59ae754838d76a606ea6be6126e40c59fff5214252b1e26d | |
|
8 | patch_url = https://wrapdb.mesonbuild.com/v1/projects/pybind11/2.3.0/2/get_zip | |
|
9 | patch_filename = pybind11-2.3.0-2-wrap.zip | |
|
10 | patch_hash = f3bed4bfc8961b3b985ff1e63fc6e57c674f35b353f0d42adbc037f9416381fb |
General Comments 0
You need to be logged in to leave comments.
Login now