Browse Source

swig: add swig support for hmc5883l sensor

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll 10 years ago
parent
commit
5c306de0a3
3 changed files with 31 additions and 0 deletions
  1. 17
    0
      src/hmc5883l/CMakeLists.txt
  2. 7
    0
      src/hmc5883l/jsupm_hmc5883l.i
  3. 7
    0
      src/hmc5883l/pyupm_hmc5883l.i

+ 17
- 0
src/hmc5883l/CMakeLists.txt View File

@@ -3,3 +3,20 @@ add_library (hmc5883l SHARED hmc5883l.cxx)
3 3
 include_directories (${MAA_INCLUDE_DIR})
4 4
 
5 5
 target_link_libraries (hmc5883l ${MAA_LIBRARIES})
6
+
7
+find_package (PythonLibs)
8
+
9
+include_directories (
10
+  ${PYTHON_INCLUDE_PATH}
11
+  ${PYTHON_INCLUDE_DIRS}
12
+  ${MAA_INCLUDE_DIR}
13
+  .
14
+)
15
+
16
+set_source_files_properties (pyupm_hmc5883l.i PROPERTIES CPLUSPLUS ON)
17
+set_source_files_properties (jsupm_hmc5883l.i PROPERTIES CPLUSPLUS ON)
18
+
19
+swig_add_module (pyupm_hmc5883l python pyupm_hmc5883l.i hmc5883l.cxx)
20
+swig_add_module (jsupm_hmc5883l python jsupm_hmc5883l.i hmc5883l.cxx)
21
+swig_link_libraries (pyupm_hmc5883l ${PYTHON_LIBRARIES} ${MAA_LIBRARIES})
22
+swig_link_libraries (jsupm_hmc5883l ${PYTHON_LIBRARIES} ${MAA_LIBRARIES})

+ 7
- 0
src/hmc5883l/jsupm_hmc5883l.i View File

@@ -0,0 +1,7 @@
1
+%module jsupm_hmc5883l
2
+
3
+%{
4
+    #include "hmc5883l.h"
5
+%}
6
+
7
+%include "hmc5883l.h"

+ 7
- 0
src/hmc5883l/pyupm_hmc5883l.i View File

@@ -0,0 +1,7 @@
1
+%module pyupm_hmc5883l
2
+
3
+%{
4
+    #include "hmc5883l.h"
5
+%}
6
+
7
+%include "hmc5883l.h"