Add README.md file
[uvc-gadget.git] / README.md
1 # uvcgadget - UVC gadget C library
2
3 uvcgadget is a pure C library that implements handling of UVC gadget functions.
4
5 ## Utilities
6
7 - uvc-gadget - Sample test application
8
9 ## Build instructions:
10
11 To compile:
12
13 ```
14 $ mkdir build
15 $ cd build
16 $ cmake ..
17 $ make -j4
18 ```
19
20 ## Cross compiling instructions:
21
22 Directions for cross compiling depend on the build environment.
23
24 For buildroot-based builds, cmake can be pointed to the toolchain file provided
25 by buildroot:
26
27 ```
28 $ mkdir build
29 $ cd build
30 $ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/output/host/usr/share/buildroot/toolchainfile.cmake ..
31 $ make -j4
32 ```
33
34 If your build environment doesn't provide a CMake toolchain file, the following
35 template can be used as a starting point.
36
37 ```
38 set(CMAKE_SYSTEM_NAME Linux)
39
40 set(BUILD_ENV_ROOT "/path/to/your/build/enviroment/root/")
41
42 # Specify the cross compiler
43 set(CMAKE_C_COMPILER   ${BUILD_ENV_ROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)
44
45 # Where is the target environment
46 set(CMAKE_FIND_ROOT_PATH ${BUILD_ENV_ROOT}/target ${BUILD_ENV_ROOT}/host)
47
48 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
49 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
50 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
51 ```