From a1c5bd87423f28d337821a9acbb9419b26743e4f Mon Sep 17 00:00:00 2001 From: Henry Bruce Date: Tue, 31 Mar 2015 13:54:10 +0100 Subject: [PATCH] CMakeLists.txt: Added option to install mraa-gpio tool This commit renames gpio.c to mraa-gpio.c to make installation in bin/ less annoying Signed-off-by: Henry Bruce Signed-off-by: Brendan Le Foll --- CMakeLists.txt | 1 + examples/CMakeLists.txt | 8 ++++++-- examples/{gpio.c => mraa-gpio.c} | 0 3 files changed, 7 insertions(+), 2 deletions(-) rename examples/{gpio.c => mraa-gpio.c} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba2fdb0..dea6a5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ option (BUILDSWIGPYTHON "Build swig python modules." ON) option (BUILDSWIGNODE "Build swig node modules." ON) option (IPK "Generate IPK using CPack" OFF) option (BUILDPYTHON3 "Use python3 for building/installing" OFF) +option (INSTALLGPIOTOOL "Install gpio tool" OFF) include (TargetArch) target_architecture (DETECTED_ARCH) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6a3c496..4f80340 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -9,7 +9,7 @@ add_executable (spi_mcp4261 spi_mcp4261.c) add_executable (mmap-io2 mmap-io2.c) add_executable (blink_onboard blink_onboard.c) add_executable (uart_setup uart_setup.c) -add_executable (gpio gpio.c) +add_executable (mraa-gpio mraa-gpio.c) add_executable (spi_max7219 spi_max7219.c) include_directories(${PROJECT_SOURCE_DIR}/api) @@ -25,9 +25,13 @@ target_link_libraries (spi_mcp4261 mraa) target_link_libraries (mmap-io2 mraa) target_link_libraries (blink_onboard mraa) target_link_libraries (uart_setup mraa) -target_link_libraries (gpio mraa) +target_link_libraries (mraa-gpio mraa) target_link_libraries (spi_max7219 mraa) add_subdirectory (c++) install (DIRECTORY ${PROJECT_SOURCE_DIR}/examples/ DESTINATION share/mraa/examples) + +if (INSTALLGPIOTOOL) + install (TARGETS mraa-gpio DESTINATION bin) +endif() diff --git a/examples/gpio.c b/examples/mraa-gpio.c similarity index 100% rename from examples/gpio.c rename to examples/mraa-gpio.c