Use proper cmake detection of features.

This attempts to organize all needed items and places appropriate defines
in a single location. Redundant comparisons/defines were removed when noticed.

A few caveats, however:

* This may be better targeted towards the 5_1_0 branch instead of master right now.
* Cmake will run a little slower on configuration/generation now. That's due to the sanity checks it runs.
* There are some more checks to be added later, but this should be a solid start.

Thanks to the [libical](https://github.com/libical/libical) project for inspiration.
This commit is contained in:
Jason Felds
2015-09-05 10:51:17 -04:00
parent 92f449c8bf
commit e093d204c8
42 changed files with 438 additions and 159 deletions
@@ -5,8 +5,13 @@
#include "LinuxInputManager.h"
#include "GamePreferences.h" //needed for Axis Fix
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif
#include <errno.h>
#include <sys/types.h>
@@ -5,8 +5,12 @@
#include "LinuxInputManager.h"
#include "RageInputDevice.h" // NUM_JOYSTICKS
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif
#include <errno.h>
#include <sys/types.h>
@@ -5,8 +5,12 @@
#include <stdio.h>
#include <string.h>
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif
#include <errno.h>
#include <sys/types.h>
@@ -16,7 +16,9 @@
#include <errno.h>
#include <sys/ioctl.h>
#if defined(HAVE_FCNTL_H)
#include <fcntl.h>
#endif
#include <linux/kd.h>
#include <linux/keyboard.h>
@@ -8,7 +8,11 @@
#include "Foreach.h"
#include <string> // std::string::npos
#if defined(HAVE_DIRENT_H)
#include <dirent.h>
#endif
#include <errno.h>
RString getDevice(RString inputDir, RString type)