1 set (libname "hmc5883l")
2 add_library (hmc5883l SHARED hmc5883l.cxx)
3 include_directories (${MAA_INCLUDE_DIR})
4 target_link_libraries (hmc5883l ${MAA_LIBRARIES})
6 if (DOXYGEN_FOUND AND SWIG_FOUND)
7 find_package (PythonLibs)
10 ${PYTHON_INCLUDE_PATH}
11 ${PYTHON_INCLUDE_DIRS}
16 set_source_files_properties (pyupm_hmc5883l.i PROPERTIES CPLUSPLUS ON)
17 set_source_files_properties (jsupm_hmc5883l.i PROPERTIES CPLUSPLUS ON)
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})
24 set (CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
25 add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${libname}_doc.i
26 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../doxy2swig.py -n
27 ${CMAKE_BINARY_DIR}/xml/${libname}_8h.xml
28 ${CMAKE_CURRENT_BINARY_DIR}/${libname}_doc.i
29 DEPENDS ${CMAKE_BINARY_DIR}/xml/${libname}_8h.xml
31 add_custom_target (${libname}doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${libname}_doc.i)
32 add_dependencies (${libname}doc_i doc)
33 add_dependencies (${SWIG_MODULE_pyupm_hmc5883l_REAL_NAME} ${libname}doc_i)