This document describes how to build and install the JetsonGPIO from the source code.
To build JetsonGPIO from the source code, the following prerequisites are needed:
git
(for cloning the source code from GitHub)CMake
(3.2 or higher)- A C++ compiler that supports C++11 (ex>
g++
,clang
, etc) - Build automation tools (ex>
GNU Make
,Ninja
, etc)
git clone https://github.com/pjueon/JetsonGPIO
cd JetsonGPIO
mkdir build && cd build
cmake .. [OPTIONS]
Option | Default value | Description |
---|---|---|
-DCMAKE_INSTALL_PREFIX= |
/usr/local |
Installation path |
-DBUILD_EXAMPLES= |
ON | Build example codes in samples |
-DJETSON_GPIO_POST_INSTALL= |
ON | Run the post-install script after installation to set user permissions. If you set this OFF , you must run your application as root to use JetsonGPIO. |
sudo cmake --build . --target install
You can add cmake option -DBUILD_EXAMPLES=ON
to build example codes in samples
.
Assuming you are in build
directory:
cmake .. -DBUILD_EXAMPLES=ON
cmake --build . --target examples
You can find the compiled results in build/samples
.