##// END OF EJS Templates
Updated meson build files...
jeandet -
r1425:697deb00ef40
parent child
Show More
@@ -0,0 +1,38
1
2 pybind11_dep = dependency('pybind11', required : true, fallback:['pybind11','pybind11_dep'])
3
4 python_providers_moc_headers = [
5 'include/python_providers.h'
6 ]
7
8 python_providers_sources = [
9 'src/python_providers.cpp'
10 ]
11
12 python_providers_inc = include_directories(['include'])
13
14
15 gen = generator(moc,
16 output : 'moc_@BASENAME@.cpp',
17 arguments : ['@INPUT@',
18 '-DSCIQLOP_PLUGIN_JSON_FILE_PATH="'+meson.source_root()+'/plugins/python_providers/resources/python_providers.json"',
19 '-I', meson.current_source_dir()+'/include',
20 '-I', meson.current_source_dir()+'/../../core/include/',
21 '-o', '@OUTPUT@'])
22
23 python_providers_moc_files = gen.process(python_providers_moc_headers)
24
25 cpp_args = ['-DPYTHON_PROVIDERS_LIB','-DQT_PLUGIN', '-DQT_NO_KEYWORDS']
26 if(get_option('default_library')=='static')
27 cpp_args += ['-DQT_STATICPLUGIN']
28 endif
29
30 sciqlop_python_providers = library('pythonproviders',
31 python_providers_sources,
32 python_providers_moc_files,
33 cpp_args : cpp_args,
34 include_directories : [python_providers_inc],
35 dependencies : [sciqlop_core, sciqlop_gui, pybind11_dep],
36 install : true,
37 install_dir : join_paths(get_option('libdir'), 'SciQLop')
38 )
@@ -1,46 +1,46
1
1
2 app_moc_headers = [
2 app_moc_headers = [
3 'include/MainWindow.h'
3 'include/MainWindow.h'
4 ]
4 ]
5
5
6 app_ui_files = [
6 app_ui_files = [
7 'ui/MainWindow.ui'
7 'ui/MainWindow.ui'
8 ]
8 ]
9
9
10 app_qresources = ['resources/qlopapp.qrc']
10 app_qresources = ['resources/qlopapp.qrc']
11
11
12 app_moc_files = qt5.preprocess(moc_headers : app_moc_headers,
12 app_moc_files = qt5.preprocess(moc_headers : app_moc_headers,
13 ui_files : app_ui_files,
13 ui_files : app_ui_files,
14 qresources : app_qresources)
14 qresources : app_qresources)
15
15
16 app_sources = [
16 app_sources = [
17 'src/Main.cpp',
17 'src/Main.cpp',
18 'src/MainWindow.cpp'
18 'src/MainWindow.cpp'
19 ]
19 ]
20
20
21 app_inc = include_directories(['include'])
21 app_inc = include_directories(['include'])
22
22
23 if host_machine.system()=='windows' or build_machine.system()=='windows'
23 if host_machine.system()=='windows' or build_machine.system()=='windows'
24 winmod = import('windows')
24 winmod = import('windows')
25 rc = winmod.compile_resources('resources/qlopapp.rc')
25 rc = winmod.compile_resources('resources/qlopapp.rc')
26 else
26 else
27 rc = []
27 rc = []
28 endif
28 endif
29
29
30 app_libs = []
30 app_libs = []
31 cpp_args = []
31 cpp_args = []
32 if 'static' == get_option('default_library')
32 if 'static' == get_option('default_library')
33 app_libs = [ sciqlop_amdaplugin, sciqlop_mockplugin]
33 app_libs = [sciqlop_mockplugin, sciqlop_python_providers]
34 cpp_args += ['-DQT_STATICPLUGIN']
34 cpp_args += ['-DQT_STATICPLUGIN']
35 endif
35 endif
36
36
37 sciqlop_app = executable('sciqlop',
37 sciqlop_app = executable('sciqlop',
38 app_sources,
38 app_sources,
39 app_moc_files,
39 app_moc_files,
40 rc,
40 rc,
41 include_directories : [ app_inc],
41 include_directories : [ app_inc],
42 link_with: app_libs,
42 link_with: app_libs,
43 cpp_args: cpp_args,
43 cpp_args: cpp_args,
44 dependencies : [sciqlop_gui, sciqlop_core],
44 dependencies : [sciqlop_gui, sciqlop_core],
45 install : true
45 install : true
46 )
46 )
@@ -1,1 +1,1
1 Subproject commit d831ff83b9bb13121444a5bd86040d4bddfe72d3
1 Subproject commit a0c89a70c83c407d12cf22096a0e7ffae4763e00
@@ -1,2 +1,3
1 subdir('mockplugin')
1 subdir('mockplugin')
2 subdir('amda')
2 subdir('python_providers')
3 #subdir('amda')
@@ -1,25 +1,26
1 #ifndef PYTHON_PROVIDERS_H
1 #ifndef PYTHON_PROVIDERS_H
2 #define PYTHON_PROVIDERS_H
2 #define PYTHON_PROVIDERS_H
3
3
4 #include <Plugin/IPlugin.h>
4 #include <Plugin/IPlugin.h>
5
5
6
6
7 #include <memory>
7 #include <memory>
8
8
9 #ifndef SCIQLOP_PLUGIN_JSON_FILE_PATH
9 #ifndef SCIQLOP_PLUGIN_JSON_FILE_PATH
10 #define SCIQLOP_PLUGIN_JSON_FILE_PATH "python_providers.json"
10 #define SCIQLOP_PLUGIN_JSON_FILE_PATH "python_providers.json"
11 #endif
11 #endif
12
12
13 class DataSourceItem;
13 class DataSourceItem;
14
14
15 class PythonProviders : public QObject, public IPlugin
15 class PythonProviders : public QObject, public IPlugin
16 {
16 {
17 Q_OBJECT
17 Q_OBJECT
18 Q_INTERFACES(IPlugin)
18 Q_INTERFACES(IPlugin)
19 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE SCIQLOP_PLUGIN_JSON_FILE_PATH)
19 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE SCIQLOP_PLUGIN_JSON_FILE_PATH)
20 public:
20 public:
21 /// @sa IPlugin::initialize()
21 /// @sa IPlugin::initialize()
22 void initialize() override;
22 void initialize() override;
23 ~PythonProviders();
23 };
24 };
24
25
25 #endif // PYTHON_PROVIDERS_H
26 #endif // PYTHON_PROVIDERS_H
@@ -1,9 +1,17
1 #include "python_providers.h"
1 #include "python_providers.h"
2 #include <pybind11/embed.h>
2 #include <pybind11/embed.h>
3 namespace py = pybind11;
3 namespace py = pybind11;
4
4
5 void PythonProviders::initialize()
5 void PythonProviders::initialize()
6 {
6 {
7 py::scoped_interpreter guard {};
7 py::initialize_interpreter(false);
8 py::print("Hello, World!");
8 py::print("Hello, World!");
9 py::print("Hello, World!");
10 py::print("Hello, World!");
11 py::print("Hello, World!");
12 }
13
14 PythonProviders::~PythonProviders()
15 {
16 py::finalize_interpreter();
9 }
17 }
General Comments 0
You need to be logged in to leave comments. Login now