cmake: Remove 'third_party/khronos' from include paths

Oops. This should have been squashed with the previous commit (a607232).

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake,readme: Move Waffle's CMake options to new file Options.cmake

This makes it easy for users to find all the custom CMake options
defined by Waffle. Update the README accordingly.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
doc: Remove building.txt

This file did several things, each not worth doing.

    1. Give a basic CMake tutorial.
       (It's not Waffle's responsibility to give a half-baked CMake
       tutorial.)

    2. List all of Waffle's custom CMake options.
       (This is now covered by Options.cmake).

    3. List some important make targets
       (This will quickly become out-of-date).

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Prefix 'check_thread_local_storage()' with 'waffle'

Let's be good code citizens and properly namespace our functions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Prefix module CheckThreadLocalStorage with Waffle

That is, rename
  CheckThreadLocalStorage.cmake -> WaffleCheckThreadLocalStorage.cmake

Let's be good code citizens. If a module is private to Waffle, then
let's prefix its name with 'Waffle'. CMake, CPack, KDE3, and Qt4 also
follows this convention.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Define version numbers in new module WaffleVersion

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Remove project name hack for GNUInstallDirs

Rename the project 'waffle' -> 'waffle1'. This coincides better with
Waffle's library versioning. It also removes the need for the ugly hack
Waffle uses to control where GNUInstallDirs installs documentation.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor configuration summary

Move the large block that prints the configuration summary into a new
module WafflePrintConfigurationSummary.

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor compiler flags into new module

Move definition of compiler flags into a new module
WaffleDefineCompilerFlags.

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor definition of internal options

Move definition of internal options into a new module
WaffleDefineInternalOptions.

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor option validation

Move validation of options into a new module WaffleValidateOptions.

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Check that gbm is not enabled on Mac

Checks for GLX, EGL, and Wayland were present. GBM was the only check
missing.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor the search for library deps

Move the search for library dependencies into a new module
WaffleFindDependencies.

This change belongs to a series that cleans up the toplevel CMakeLists
by decompositing it into modules.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor installation of FindWaffle.cmake

The presence of file `cmake/CMakeLists.txt` feels very strange.  I found
no other project that had a CMakeLists there. Goodbye strange file.

File `cmake/CMakeLists.txt` did exactly one thing: define the install
rule for `FindWaffle.cmake`. Kill the file and move the install rule to
the toplevel CMakeLists.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor targets 'check', 'check-func'

They were defined in the toplevel CMakeLists.txt. Move them to
`tests/CMakeLists.txt.`

This change belongs to a series that cleans up the toplevel CMakeLists
by decomposing it.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Fix some ugly formatting

After all the recent cleanups, there exists some residual formatting
that needs cleaning up.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cmake: Refactor detection of operating system

Add new module WaffleDefineOS that defines booleans `waffle_on_linux`
and `waffle_on_mac`. Replace each check on CMAKE_SYSTEM_NAME with
a check on one of these new bools.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch chadv/cmake-cleanup