2 ${PROJECT_SOURCE_DIR}/api
3 ${PROJECT_SOURCE_DIR}/include
7 ${PROJECT_SOURCE_DIR}/src/maa.c
8 ${PROJECT_SOURCE_DIR}/src/gpio/gpio.c
9 ${PROJECT_SOURCE_DIR}/src/i2c/i2c.c
10 ${PROJECT_SOURCE_DIR}/src/i2c/smbus.c
11 ${PROJECT_SOURCE_DIR}/src/pwm/pwm.c
12 ${PROJECT_SOURCE_DIR}/src/spi/spi.c
13 ${PROJECT_SOURCE_DIR}/src/aio/aio.c
14 ${PROJECT_SOURCE_DIR}/src/intel_galileo_rev_d.c
15 # autogenerated version file
16 ${CMAKE_CURRENT_BINARY_DIR}/version.c
19 add_library (maa SHARED ${maa_LIB_SRCS})
20 target_link_libraries (maa ${CMAKE_THREAD_LIBS_INIT})
22 set_target_properties(
25 SOVERSION ${maa_VERSION_MAJOR}
26 VERSION ${maa_VERSION_STRING}
28 install (DIRECTORY ${PROJECT_SOURCE_DIR}/api/ DESTINATION include/maa)
30 macro (maa_CREATE_INSTALL_PKGCONFIG generated_file install_location)
31 configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
32 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
33 endmacro (maa_CREATE_INSTALL_PKGCONFIG)
34 maa_create_install_pkgconfig (maa.pc lib${LIB_SUFFIX}/pkgconfig)
36 install (TARGETS maa DESTINATION lib)
39 set (CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
40 set (DOCFILES maa pwm i2c gpio aio spi)
41 foreach (_file ${DOCFILES})
42 add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i
43 COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxy2swig.py -n
44 ${CMAKE_BINARY_DIR}/xml/${_file}_8h.xml
45 ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i
46 DEPENDS ${CMAKE_BINARY_DIR}/xml/${_file}_8h.xml
48 add_custom_target (${_file}doc_i DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_file}_doc.i)
49 add_dependencies (${_file}doc_i doc)
55 include (${SWIG_USE_FILE})
57 add_subdirectory (python)
58 add_subdirectory (javascript)