##// END OF EJS Templates
Minor build fixes on Python stuff detection...
jeandet -
r1488:dd3017c130fb
parent child
Show More
@@ -1,46 +1,50
1 shiboken2 = find_program('shiboken2')
1 shiboken2 = find_program('shiboken2')
2 qmake = find_program('qmake-qt5','qmake')
2 qmake = find_program('qmake-qt5','qmake')
3
3
4 pymod = import('python')
4 pymod = import('python')
5 python3 = pymod.find_installation('python3', modules:['PySide2','shiboken2', 'shiboken2_generator'])
5 python3 = pymod.find_installation('python3', modules:['PySide2','shiboken2', 'shiboken2_generator', 'numpy'])
6 python3_dep = python3.dependency()
7 numpy_inc = run_command(python3, '-c', 'import numpy;print(numpy.get_include())').stdout().strip('\n')
6
8
7 qt5_modules = ['QtCore','QtGui','QtWidgets']
9 qt5_modules = ['QtCore','QtGui','QtWidgets']
8
10
9 qt_headers_path = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip('\n')
11 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(';')
12 generated_srcs = run_command(python3, 'src_list.py', 'meson').stdout().split(';')
11
13
12 modules_arg = '--modules=@0@'.format(','.join(qt5_modules))
14 modules_arg = '--modules=@0@'.format(','.join(qt5_modules))
13
15
14 shiboken2_build_flags = run_command(python3, 'shiboken-helper.py', '--includes', modules_arg).stdout().strip('\n').split(' ')
16 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(' ')
17 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')
18 shiboken2_typesystem = run_command(python3, 'shiboken-helper.py', '--typesystem').stdout().strip('\n')
17
19
18 sciqlop_bindings_incs = shiboken2_build_flags + [
20 sciqlop_bindings_incs = shiboken2_build_flags + [
19 '-I'+meson.current_source_dir()+'/../../gui/include',
21 '-I'+meson.current_source_dir()+'/../../gui/include',
20 '-I'+meson.current_source_dir()+'/../../core/include',
22 '-I'+meson.current_source_dir()+'/../../core/include',
21 '-I'+meson.current_source_dir()+'/../../subprojects/TimeSeries/include',
23 '-I'+meson.current_source_dir()+'/../../subprojects/TimeSeries/include',
22 '-I'+meson.current_source_dir()+'/../../subprojects/cpp_utils/include',
24 '-I'+meson.current_source_dir()+'/../../subprojects/cpp_utils/include',
23 '-I'+python3.get_path('include'),
25 '-I'+python3.get_path('include'),
24 '-I'+qt_headers_path
26 '-I'+qt_headers_path,
27 '-I'+numpy_inc
25 ]
28 ]
26
29
27 foreach mod:qt5_modules
30 foreach mod:qt5_modules
28 sciqlop_bindings_incs += ['-I'+qt_headers_path+'/'+mod]
31 sciqlop_bindings_incs += ['-I'+qt_headers_path+'/'+mod]
29 endforeach
32 endforeach
30
33
31
34
32 sciqlop_bindings_src = files('bindings.h', 'PyDataProvider.h', 'numpy_wrappers.h', 'numpy_wrappers.cpp')
35 sciqlop_bindings_src = files('bindings.h', 'PyDataProvider.h', 'numpy_wrappers.h', 'numpy_wrappers.cpp')
33
36
34 subdir('SciQLopBindings')
37 subdir('SciQLopBindings')
35 subdir('plugins')
38 subdir('plugins')
36
39
37 shiboken_dep = declare_dependency(compile_args: shiboken2_build_flags, link_args: shiboken2_link_flags)
40 shiboken_dep = declare_dependency(compile_args: shiboken2_build_flags, link_args: shiboken2_link_flags)
38
41
39 sciqlop_bindings = python3.extension_module('SciQLopBindings',sciqlop_bindings_src,shiboken2_generator_out,
42 sciqlop_bindings = python3.extension_module('SciQLopBindings',sciqlop_bindings_src,shiboken2_generator_out,
40 dependencies : [sciqlop_app_dep, python3.dependency(), shiboken_dep, cpp_utils_dep],
43 dependencies : [sciqlop_app_dep, python3_dep, shiboken_dep, cpp_utils_dep],
44 include_directories : numpy_inc
41 )
45 )
42
46
43
47
44 configure_file(input:'main.py', output:'main.py', copy:true)
48 configure_file(input:'main.py', output:'main.py', copy:true)
45
49
46 executable('sciqlop', 'main.cpp', dependencies :python3.dependency())
50 executable('sciqlop', 'main.cpp', dependencies :python3.dependency())
@@ -1,54 +1,61
1 project('SciQLOP', 'cpp',default_options : ['cpp_std=c++17'], meson_version:'>=0.51.0')
1 project(
2 add_global_arguments('-DSCIQLOP_VERSION="1.1.0"', language : 'cpp')
2 'SciQLOP',
3 'cpp',
4 default_options : 'cpp_std=c++17',
5 meson_version : '>=0.51.0',
6 version : '1.1.0',
7 license : 'GPL3'
8 )
9 add_global_arguments('-DSCIQLOP_VERSION="@0@"'.format(meson.project_version()), language : 'cpp')
3
10
4 qt5 = import('qt5')
11 qt5 = import('qt5')
5 qt5core = dependency('qt5', modules : 'Core')
12 qt5core = dependency('qt5', modules : 'Core')
6 qt5widgets = dependency('qt5', modules : 'Widgets')
13 qt5widgets = dependency('qt5', modules : 'Widgets')
7 qt5gui = dependency('qt5', modules : 'Gui')
14 qt5gui = dependency('qt5', modules : 'Gui')
8 qt5svg = dependency('qt5', modules : 'Svg')
15 qt5svg = dependency('qt5', modules : 'Svg')
9 qt5xml = dependency('qt5', modules : 'Xml')
16 qt5xml = dependency('qt5', modules : 'Xml')
10 qt5network = dependency('qt5', modules : 'Network')
17 qt5network = dependency('qt5', modules : 'Network')
11 qt5printsupport = dependency('qt5', modules : 'PrintSupport')
18 qt5printsupport = dependency('qt5', modules : 'PrintSupport')
12 qt5Concurrent = dependency('qt5', modules : 'Concurrent')
19 qt5Concurrent = dependency('qt5', modules : 'Concurrent')
13 qt5test = dependency('qt5', modules : 'Test')
20 qt5test = dependency('qt5', modules : 'Test')
14
21
15 cpp_utils_dep = dependency('cpp_utils', fallback:['cpp_utils','cpp_utils_dep'])
22 cpp_utils_dep = dependency('cpp_utils', fallback:['cpp_utils','cpp_utils_dep'])
16
23
17 moc = find_program('moc-qt5','moc')
24 moc = find_program('moc-qt5','moc')
18 rcc = find_program('rcc-qt5','rcc')
25 rcc = find_program('rcc-qt5','rcc')
19
26
20 if build_machine.system()=='darwin'
27 if build_machine.system()=='darwin'
21 add_global_link_arguments('-headerpad_max_install_names', language : 'cpp')
28 add_global_link_arguments('-headerpad_max_install_names', language : 'cpp')
22 install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources')
29 install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources')
23 install_data('build_cfg/mac/Info.plist', install_dir : 'Contents')
30 install_data('build_cfg/mac/Info.plist', install_dir : 'Contents')
24 meson.add_install_script('build_cfg/mac/install_script.sh')
31 meson.add_install_script('build_cfg/mac/install_script.sh')
25 elif host_machine.system()=='windows'
32 elif host_machine.system()=='windows'
26 meson.add_install_script('build_cfg/windows/install_script.sh')
33 meson.add_install_script('build_cfg/windows/install_script.sh')
27 elif host_machine.system()=='linux'
34 elif host_machine.system()=='linux'
28 install_data('app/resources/sciqlopLOGO.svg', install_dir : 'share/icons/hicolor/scalable/')
35 install_data('app/resources/sciqlopLOGO.svg', install_dir : 'share/icons/hicolor/scalable/')
29 install_data('app/resources/SciQLOP.desktop', install_dir : 'share/applications')
36 install_data('app/resources/SciQLOP.desktop', install_dir : 'share/applications')
30 install_data('app/resources/SciQLOP.appdata.xml', install_dir : 'share/metainfo')
37 install_data('app/resources/SciQLOP.appdata.xml', install_dir : 'share/metainfo')
31 endif
38 endif
32
39
33 # Sets AMDA server that will be used during execution.
40 # Sets AMDA server that will be used during execution.
34 # Available values are:
41 # Available values are:
35 # - "default": default AMDA server
42 # - "default": default AMDA server
36 # - "amdatest": AMDA test server
43 # - "amdatest": AMDA test server
37 # - "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)
44 # - "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)
38 # - "localhost": use local AMDA server
45 # - "localhost": use local AMDA server
39 # Any other value will lead to the use of the default server
46 # Any other value will lead to the use of the default server
40 add_project_arguments('-DSCIQLOP_AMDA_SERVER="hybrid"', language : 'cpp')
47 add_project_arguments('-DSCIQLOP_AMDA_SERVER="hybrid"', language : 'cpp')
41
48
42 subdir('core')
49 subdir('core')
43 subdir('gui')
50 subdir('gui')
44 subdir('plugins')
51 subdir('plugins')
45 subdir('app')
52 subdir('app')
46
53
47 cppcheck = find_program('cppcheck', required : false)
54 cppcheck = find_program('cppcheck', required : false)
48
55
49 if cppcheck.found()
56 if cppcheck.found()
50 run_target('cppcheck',
57 run_target('cppcheck',
51 command : [cppcheck, '--enable=all',
58 command : [cppcheck, '--enable=all',
52 '--project=' + join_paths(meson.build_root(), 'compile_commands.json')]
59 '--project=' + join_paths(meson.build_root(), 'compile_commands.json')]
53 )
60 )
54 endif
61 endif
General Comments 0
You need to be logged in to leave comments. Login now