Gainput  v1.0.0
Building

Gainput is built using CMake which makes it easy to build the library.

Simply run these commands:

  1. mkdir build
  2. cd build
  3. cmake ..
  4. make

There are the regular CMake build configurations from which you choose by adding one these to the cmake call, for example:

Building Gainput as shown above, will build a dynamic-link library, a static-link library, and all samples. The executables can be found in the build/ folder.

Build Configuration Defines

There is a number of defines that determine what is included in the library and how it behaves. Normally, most of these are set by the build scripts or in gainput.h, but it may be necessary to set these when doing custom builds or modifying the build process. All defines must be set during compilation of the library itself.

Name Description
GAINPUT_DEBUG Enables debugging of the library itself, i.e. enables a lot of internal logs and checks.
GAINPUT_DEV Enables the built-in development tool server that external tools or other Gainput instances can connect to.
GAINPUT_ENABLE_ALL_GESTURES Enables all gestures. Note that there is also an individual define for each gesture (see gainput::InputGesture).
GAINPUT_ENABLE_RECORDER Enables recording of inputs.
GAINPUT_LIB_BUILD Should be set if Gainput is being built as a library.

Android NDK

In order to cross-compile for Android, the build has to be configured differently.

Naturally, the Android NDK must be installed. Make sure that ANDROID_NDK_PATH is set to the absolute path to your installation. And then follow these steps:

Executing these commands will also yield both a dynamic and static library in the build/ folder.