${PROJECT_SOURCE_DIR}/include
)
+set (maa_LIB_HEADERS
+ ${PROJECT_SOURCE_DIR}/api/maa.h
+ ${PROJECT_SOURCE_DIR}/api/gpio.h
+ ${PROJECT_SOURCE_DIR}/api/i2c.h
+ ${PROJECT_SOURCE_DIR}/api/pwm.h
+ ${PROJECT_SOURCE_DIR}/api/spi.h
+ ${PROJECT_SOURCE_DIR}/api/aio.h
+ ${PROJECT_SOURCE_DIR}/include/smbus.h
+ ${PROJECT_SOURCE_DIR}/include/version.h
+ ${PROJECT_SOURCE_DIR}/include/intel_galileo_rev_d.h
+)
+
+set (maa_LIB_KERNEL
+ ${PROJECT_SOURCE_DIR}/include/linux/compiler.h
+ ${PROJECT_SOURCE_DIR}/include/linux/i2c-dev.h
+ ${PROJECT_SOURCE_DIR}/include/linux/posix_types.h
+ ${PROJECT_SOURCE_DIR}/include/linux/types.h
+)
+
set (maa_LIB_SRCS
- ${PROJECT_SOURCE_DIR}/src/maa.cxx
- ${PROJECT_SOURCE_DIR}/src/i2c/i2c.cxx
- ${PROJECT_SOURCE_DIR}/src/i2c/i2cslave.cxx
- ${PROJECT_SOURCE_DIR}/src/i2c/smbus.c
+ ${PROJECT_SOURCE_DIR}/src/maa.c
${PROJECT_SOURCE_DIR}/src/gpio/gpio.c
- ${PROJECT_SOURCE_DIR}/src/pwm/pwm.cxx
+ ${PROJECT_SOURCE_DIR}/src/i2c/i2c.c
+ ${PROJECT_SOURCE_DIR}/src/i2c/smbus.c
+ ${PROJECT_SOURCE_DIR}/src/pwm/pwm.c
+ ${PROJECT_SOURCE_DIR}/src/spi/spi.c
+ ${PROJECT_SOURCE_DIR}/src/aio/aio.c
+ ${PROJECT_SOURCE_DIR}/src/intel_galileo_rev_d.c
+# autogenerated version file
+ ${CMAKE_CURRENT_BINARY_DIR}/version.c
)
add_library (maa SHARED ${maa_LIB_SRCS})
VERSION ${maa_VERSION_STRING}
)
install (FILES ${maa_LIB_HEADERS} DESTINATION include/maa)
+install (FILES ${maa_LIB_KERNEL} DESTINATION include/maa/linux)
-macro(maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
- configure_file(${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
-endmacro(maa_CREATE_INSTALL_PKGCONFIG)
-maa_create_install_pkgconfig(maa.pc lib${LIB_SUFFIX}/pkgconfig)
+macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
+ configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
+endmacro (maa_CREATE_INSTALL_PKGCONFIG)
+maa_create_install_pkgconfig (maa.pc lib${LIB_SUFFIX}/pkgconfig)
install (TARGETS maa DESTINATION lib)
-add_subdirectory (python)
-add_subdirectory (javascript)
+if (DOXYGEN_FOUND)
+ set (CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
+ set (DOCFILES maa pwm i2c gpio aio spi)
+ foreach (_file ${DOCFILES})
+ add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py -n
+ ${CMAKE_BINARY_DIR}/xml/${_file}_8h.xml
+ ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i
+ DEPENDS ${CMAKE_BINARY_DIR}/xml/${_file}_8h.xml
+ )
+ add_custom_target (${_file}doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i)
+ add_dependencies (${_file}doc_i doc)
+ endforeach ()
+endif ()
+
+find_package (SWIG)
+if (SWIG_FOUND)
+ include (${SWIG_USE_FILE})
+
+ add_subdirectory (python)
+# add_subdirectory (javascript)
+endif ()