##// END OF EJS Templates
Update Meson build def...
jeandet -
r1480:fb552be9c83a
parent child
Show More
@@ -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
@@ -1,48 +1,66
1
1
2 app_moc_headers = [
2 app_moc_headers = [
3 'include/MainWindow.h',
3 'include/MainWindow.h',
4 'include/toolbar.h'
4 'include/toolbar.h'
5 ]
5 ]
6
6
7 app_ui_files = [
7 app_ui_files = [
8 'ui/MainWindow.ui'
8 'ui/MainWindow.ui'
9 ]
9 ]
10
10
11 app_qresources = ['resources/qlopapp.qrc']
11 app_qresources = ['resources/qlopapp.qrc']
12
12
13 app_moc_files = qt5.preprocess(moc_headers : app_moc_headers,
13 app_moc_files = qt5.preprocess(moc_headers : app_moc_headers,
14 ui_files : app_ui_files,
14 ui_files : app_ui_files,
15 qresources : app_qresources)
15 qresources : app_qresources)
16
16
17 app_sources = [
17 app_sources = [
18 'src/Main.cpp',
18 'src/Main.cpp',
19 'src/MainWindow.cpp',
19 'src/MainWindow.cpp',
20 'src/toolbar.cpp'
20 'src/toolbar.cpp'
21 ]
21 ]
22
22
23 app_inc = include_directories(['include'])
23 app_inc = include_directories(['include'])
24
24
25 if host_machine.system()=='windows' or build_machine.system()=='windows'
25 if host_machine.system()=='windows' or build_machine.system()=='windows'
26 winmod = import('windows')
26 winmod = import('windows')
27 rc = winmod.compile_resources('resources/qlopapp.rc')
27 rc = winmod.compile_resources('resources/qlopapp.rc')
28 else
28 else
29 rc = []
29 rc = []
30 endif
30 endif
31
31
32 app_libs = []
32 app_libs = []
33 cpp_args = []
33 cpp_args = []
34 if 'static' == get_option('default_library')
34 if 'static' == get_option('default_library')
35 app_libs = [sciqlop_python_providers]
35 app_libs = [sciqlop_python_providers]
36 cpp_args += ['-DQT_STATICPLUGIN']
36 cpp_args += ['-DQT_STATICPLUGIN']
37 endif
37 endif
38
38
39 sciqlop_app = executable('sciqlop',
39 sciqlop_app = executable('sciqlop',
40 app_sources,
40 app_sources,
41 app_moc_files,
41 app_moc_files,
42 rc,
42 rc,
43 include_directories : [ app_inc],
43 include_directories : [ app_inc],
44 link_with: app_libs,
44 link_with: app_libs,
45 cpp_args: cpp_args,
45 cpp_args: cpp_args,
46 dependencies : [sciqlop_gui, sciqlop_core],
46 dependencies : [sciqlop_gui, sciqlop_core],
47 install : true
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,52 +1,52
1 project('SciQLOP', 'cpp',default_options : ['cpp_std=c++17'], meson_version:'>=0.47.0')
1 project('SciQLOP', 'cpp',default_options : ['cpp_std=c++17'], meson_version:'>=0.51.0')
2 add_global_arguments('-DSCIQLOP_VERSION="1.1.0"', language : 'cpp')
2 add_global_arguments('-DSCIQLOP_VERSION="1.1.0"', language : 'cpp')
3
3
4 qt5 = import('qt5')
4 qt5 = import('qt5')
5 qt5core = dependency('qt5', modules : 'Core')
5 qt5core = dependency('qt5', modules : 'Core')
6 qt5widgets = dependency('qt5', modules : 'Widgets')
6 qt5widgets = dependency('qt5', modules : 'Widgets')
7 qt5gui = dependency('qt5', modules : 'Gui')
7 qt5gui = dependency('qt5', modules : 'Gui')
8 qt5svg = dependency('qt5', modules : 'Svg')
8 qt5svg = dependency('qt5', modules : 'Svg')
9 qt5xml = dependency('qt5', modules : 'Xml')
9 qt5xml = dependency('qt5', modules : 'Xml')
10 qt5network = dependency('qt5', modules : 'Network')
10 qt5network = dependency('qt5', modules : 'Network')
11 qt5printsupport = dependency('qt5', modules : 'PrintSupport')
11 qt5printsupport = dependency('qt5', modules : 'PrintSupport')
12 qt5Concurrent = dependency('qt5', modules : 'Concurrent')
12 qt5Concurrent = dependency('qt5', modules : 'Concurrent')
13 qt5test = dependency('qt5', modules : 'Test')
13 qt5test = dependency('qt5', modules : 'Test')
14
14
15 moc = find_program('moc-qt5','moc')
15 moc = find_program('moc-qt5','moc')
16 rcc = find_program('rcc-qt5','rcc')
16 rcc = find_program('rcc-qt5','rcc')
17
17
18 if build_machine.system()=='darwin'
18 if build_machine.system()=='darwin'
19 add_global_link_arguments('-headerpad_max_install_names', language : 'cpp')
19 add_global_link_arguments('-headerpad_max_install_names', language : 'cpp')
20 install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources')
20 install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources')
21 install_data('build_cfg/mac/Info.plist', install_dir : 'Contents')
21 install_data('build_cfg/mac/Info.plist', install_dir : 'Contents')
22 meson.add_install_script('build_cfg/mac/install_script.sh')
22 meson.add_install_script('build_cfg/mac/install_script.sh')
23 elif host_machine.system()=='windows'
23 elif host_machine.system()=='windows'
24 meson.add_install_script('build_cfg/windows/install_script.sh')
24 meson.add_install_script('build_cfg/windows/install_script.sh')
25 elif host_machine.system()=='linux'
25 elif host_machine.system()=='linux'
26 install_data('app/resources/sciqlopLOGO.svg', install_dir : 'share/icons/hicolor/scalable/')
26 install_data('app/resources/sciqlopLOGO.svg', install_dir : 'share/icons/hicolor/scalable/')
27 install_data('app/resources/SciQLOP.desktop', install_dir : 'share/applications')
27 install_data('app/resources/SciQLOP.desktop', install_dir : 'share/applications')
28 install_data('app/resources/SciQLOP.appdata.xml', install_dir : 'share/metainfo')
28 install_data('app/resources/SciQLOP.appdata.xml', install_dir : 'share/metainfo')
29 endif
29 endif
30
30
31 # Sets AMDA server that will be used during execution.
31 # Sets AMDA server that will be used during execution.
32 # Available values are:
32 # Available values are:
33 # - "default": default AMDA server
33 # - "default": default AMDA server
34 # - "amdatest": AMDA test server
34 # - "amdatest": AMDA test server
35 # - "hybrid": use both the default server and the test server (the server used is relative to each product, according to its "server" property in the JSON file)
35 # - "hybrid": use both the default server and the test server (the server used is relative to each product, according to its "server" property in the JSON file)
36 # - "localhost": use local AMDA server
36 # - "localhost": use local AMDA server
37 # Any other value will lead to the use of the default server
37 # Any other value will lead to the use of the default server
38 add_project_arguments('-DSCIQLOP_AMDA_SERVER="hybrid"', language : 'cpp')
38 add_project_arguments('-DSCIQLOP_AMDA_SERVER="hybrid"', language : 'cpp')
39
39
40 subdir('core')
40 subdir('core')
41 subdir('gui')
41 subdir('gui')
42 subdir('plugins')
42 subdir('plugins')
43 subdir('app')
43 subdir('app')
44
44
45 cppcheck = find_program('cppcheck', required : false)
45 cppcheck = find_program('cppcheck', required : false)
46
46
47 if cppcheck.found()
47 if cppcheck.found()
48 run_target('cppcheck',
48 run_target('cppcheck',
49 command : [cppcheck, '--enable=all',
49 command : [cppcheck, '--enable=all',
50 '--project=' + join_paths(meson.build_root(), 'compile_commands.json')]
50 '--project=' + join_paths(meson.build_root(), 'compile_commands.json')]
51 )
51 )
52 endif
52 endif
@@ -1,3 +1,3
1 #subdir('mockplugin')
1 #subdir('mockplugin')
2 subdir('python_providers')
2 #subdir('python_providers')
3 #subdir('amda')
3 #subdir('amda')
@@ -1,10 +1,10
1 [wrap-file]
1 [wrap-file]
2 directory = googletest-release-1.8.0
2 directory = googletest-release-1.8.1
3
3
4 source_url = https://github.com/google/googletest/archive/release-1.8.0.zip
4 source_url = https://github.com/google/googletest/archive/release-1.8.1.zip
5 source_filename = gtest-1.8.0.zip
5 source_filename = gtest-1.8.1.zip
6 source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf
6 source_hash = 927827c183d01734cc5cfef85e0ff3f5a92ffe6188e0d18e909c5efebf28a0c7
7
7
8 patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip
8 patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.1/1/get_zip
9 patch_filename = gtest-1.8.0-5-wrap.zip
9 patch_filename = gtest-1.8.1-1-wrap.zip
10 patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5
10 patch_hash = f79f5fd46e09507b3f2e09a51ea6eb20020effe543335f5aee59f30cc8d15805
@@ -1,10 +1,10
1 [wrap-file]
1 [wrap-file]
2 directory = pybind11-2.2.2
2 directory = pybind11-2.3.0
3
3
4 source_url = https://github.com/pybind/pybind11/archive/v2.2.2.zip
4 source_url = https://github.com/pybind/pybind11/archive/v2.3.0.zip
5 source_filename = pybind11-2.2.2.zip
5 source_filename = pybind11-2.3.0.zip
6 source_hash = 20314968531faa4c8579da2c46c2ce13aecd68ae79b6dd8cf9b99698b2304348
6 source_hash = 1f844c071d9d98f5bb08458f128baa0aa08a9e5939a6b42276adb1bacd8b483e
7
7
8 patch_url = https://wrapdb.mesonbuild.com/v1/projects/pybind11/2.2.2/1/get_zip
8 patch_url = https://wrapdb.mesonbuild.com/v1/projects/pybind11/2.3.0/2/get_zip
9 patch_filename = pybind11-2.2.2-1-wrap.zip
9 patch_filename = pybind11-2.3.0-2-wrap.zip
10 patch_hash = 18a273260a59368b59ae754838d76a606ea6be6126e40c59fff5214252b1e26d
10 patch_hash = f3bed4bfc8961b3b985ff1e63fc6e57c674f35b353f0d42adbc037f9416381fb
General Comments 0
You need to be logged in to leave comments. Login now