Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Merge branch 'feature/cmake'
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuhlmann committed May 7, 2015
2 parents c8b3580 + 3fd7678 commit d039050
Show file tree
Hide file tree
Showing 35 changed files with 11,411 additions and 2,086 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
.lock-*
.cproject
.project
.waf*/
waf-*/
waf3-*/
build/
__pycache__/
.depproj/
gainput_2008.*
docs/
test/Catch/
gainput.sdf
gainput.sln
gainput.unsuccessfulbuild
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ language: cpp
compiler:
- gcc
- clang
# Change this to your needs
script: ./waf configure && ./waf build_debug && ./waf build_dev && ./waf build_release && cd test/ && ../waf configure && ../waf build && build/gainputtest && cd ..
script: mkdir build_debug && cd build_debug/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && make && test/gainputtest && cd .. && mkdir build_release && cd build_release/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make && test/gainputtest
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 2.8)

if(!WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
endif()

if(ANDROID)
include(extern/cmake/AndroidNdkModules.cmake)
android_ndk_import_module_native_app_glue()
endif()

add_subdirectory(lib)
add_subdirectory(samples)
add_subdirectory(test)


31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Gainput
=======

*Gainput is currently in development and may still have some major issues. However, it's getting there and you should check it out. Feedback is always welcome!*
*Gainput is in development. You should check it out. Feedback is always welcome!*

Gainput is the new awesome C++ input library for your game:
Gainput is the awesome C++ input library for your game:

- handles your input needs from low-level device reading to high-level mapping of user-defined buttons
- well-documented, clean, lightweight, and easy to use
Expand Down Expand Up @@ -78,13 +78,17 @@ Features
Building [![Build Status](https://travis-ci.org/jkuhlmann/gainput.png?branch=master)](https://travis-ci.org/jkuhlmann/gainput)
--------
By default, Gainput is built using [Waf](http://code.google.com/p/waf/).
By default, Gainput is built using [CMake](http://www.cmake.org/).
1. Run `waf configure`
- For Android NDK, run `waf configure --cross-android --cross-android-ndk=ANDROID_NDK_PATH` instead where `ANDROID_NDK_PATH` is the absolute path to your Android NDK.
1. Run `waf build_debug` or `waf build_release`
1. The executables can be found in `build/debug/` or `build/release/` respectively.
1. Run `mkdir build`
1. Run `cmake ..`
1. Run `make`
1. The library can be found in `lib/`, the executables in `samples/`.
Android:
1. Make sure that the environment variable `ANDROID_NDK` is set to point to your copy of the Android NDK.
1. Run CMake with the following options: `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"`
1. Follow the normal build steps above.
Contributing
------------
Expand All @@ -95,24 +99,15 @@ Everyone is welcome to contribute to the library. If you find any problems, you
Dependencies
------------
Gainput has a minimal number of external dependencies to make it as self-contained as possible. It uses the platforms' default ways of getting inputs and doesn't use any STL.
[Python](http://www.python.org/) is required for building.
Gainput has a minimal number of external dependencies to make it as self-contained as possible. It uses the platforms' default ways of getting inputs and doesn't use the STL.
Testing
-------
Generally, testing should be done by building and running Gainput on all supported platforms. The samples in the `samples/` folder should be used in order to determine if the library is functional.
The unit tests in the `test/` folder are built and run like this:
1. `cd test/`
1. `../waf configure`
1. `../waf build`
1. `build/gainputtest`
Furthermore, all build configurations and unit tests are built and run by Travis CI whenever something is pushed into the repository.
The unit tests in the `test/` folder are built by the normal CMake build. The executable can be found in the `test/` folder. All build configurations and unit tests are built and run by Travis CI whenever something is pushed into the repository.
Alternatives
Expand Down
Loading

0 comments on commit d039050

Please sign in to comment.