Gainput
v1.0.0
|
Gainput is built using CMake which makes it easy to build the library.
Simply run these commands:
mkdir build
cd build
cmake ..
make
There are the regular CMake build configurations from which you choose by adding one these to the cmake
call, for example:
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_BUILD_TYPE=Release
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.
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. |
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:
cmake -DCMAKE_TOOLCHAIN_FILE=../extern/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Debug -DANDROID_ABI="armeabi-v7a" -DANDROID_NATIVE_API_LEVEL=android-19 -DANDROID_STL="gnustl_static"
Executing these commands will also yield both a dynamic and static library in the build/
folder.