tools: add new tools directory
This is the start of the series of commits focussed on cleaning up the exmaples/ directory. This commit moves mraa-gpio, mraa-i2c, mraa-uart files out of examples directory into new tools directory. Moved files are the good cadidates to be treated as tools instead of examples. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
c24a8f8b20
commit
ec26f92fe6
@@ -271,3 +271,7 @@ if (BUILDTESTS AND PYTHON_DEFAULT_EXECUTABLE)
|
||||
enable_testing ()
|
||||
add_subdirectory (tests)
|
||||
endif ()
|
||||
|
||||
if (INSTALLTOOLS)
|
||||
add_subdirectory (tools)
|
||||
endif()
|
||||
|
||||
@@ -9,17 +9,12 @@ add_executable (spi_mcp4261 spi_mcp4261.c)
|
||||
add_executable (mmap-io2 mmap-io2.c)
|
||||
add_executable (blink_onboard blink_onboard.c)
|
||||
add_executable (uart uart.c)
|
||||
add_executable (mraa-gpio mraa-gpio.c)
|
||||
add_executable (mraa-i2c mraa-i2c.c)
|
||||
add_executable (mraa-uart mraa-uart.c)
|
||||
add_executable (spi_max7219 spi_max7219.c)
|
||||
if (NOT ANDROID_TOOLCHAIN)
|
||||
add_executable (iio_driver iio_driver.c)
|
||||
endif ()
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/api)
|
||||
# FIXME Hack to access mraa internal types used by mraa-i2c
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/api/mraa)
|
||||
|
||||
target_link_libraries (hellomraa mraa)
|
||||
@@ -33,9 +28,6 @@ target_link_libraries (spi_mcp4261 mraa)
|
||||
target_link_libraries (mmap-io2 mraa)
|
||||
target_link_libraries (blink_onboard mraa)
|
||||
target_link_libraries (uart mraa)
|
||||
target_link_libraries (mraa-gpio mraa)
|
||||
target_link_libraries (mraa-i2c mraa)
|
||||
target_link_libraries (mraa-uart mraa)
|
||||
target_link_libraries (spi_max7219 mraa)
|
||||
if (NOT ANDROID_TOOLCHAIN)
|
||||
target_link_libraries (iio_driver mraa)
|
||||
@@ -57,13 +49,3 @@ if (NOT ANDROID_TOOLCHAIN)
|
||||
endif ()
|
||||
|
||||
install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION ${CMAKE_INSTALL_DATADIR}/mraa/examples)
|
||||
|
||||
if (INSTALLGPIOTOOL AND NOT INSTALLTOOLS)
|
||||
install (TARGETS mraa-gpio DESTINATION bin)
|
||||
endif()
|
||||
|
||||
if (INSTALLTOOLS)
|
||||
install (TARGETS mraa-gpio DESTINATION bin)
|
||||
install (TARGETS mraa-i2c DESTINATION bin)
|
||||
install (TARGETS mraa-uart DESTINATION bin)
|
||||
endif()
|
||||
|
||||
22
tools/CMakeLists.txt
Normal file
22
tools/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
add_executable (mraa-gpio mraa-gpio.c)
|
||||
add_executable (mraa-i2c mraa-i2c.c)
|
||||
add_executable (mraa-uart mraa-uart.c)
|
||||
|
||||
include_directories (${PROJECT_SOURCE_DIR}/api)
|
||||
# FIXME Hack to access mraa internal types used by mraa-i2c
|
||||
include_directories (${PROJECT_SOURCE_DIR}/include)
|
||||
include_directories (${PROJECT_SOURCE_DIR}/api/mraa)
|
||||
|
||||
target_link_libraries (mraa-gpio mraa)
|
||||
target_link_libraries (mraa-i2c mraa)
|
||||
target_link_libraries (mraa-uart mraa)
|
||||
|
||||
if (INSTALLGPIOTOOL AND NOT INSTALLTOOLS)
|
||||
install (TARGETS mraa-gpio DESTINATION bin)
|
||||
endif()
|
||||
|
||||
if (INSTALLTOOLS)
|
||||
install (TARGETS mraa-gpio DESTINATION bin)
|
||||
install (TARGETS mraa-i2c DESTINATION bin)
|
||||
install (TARGETS mraa-uart DESTINATION bin)
|
||||
endif()
|
||||
Reference in New Issue
Block a user