Clang: Add separate "AppleClang" compiler id

Apple distributes their own Clang build with their own version numbers
that differ from upstream Clang.  Use the __apple_build_version__ symbol
to identify the Apple Clang compiler and report the Apple Build Version
as the fourth version component in CMAKE_<LANG>_COMPILER_VERSION.  Add
Compiler/AppleClang-<lang> and Platform/Darwin-AppleClang-<lang> modules
that simply include the upstream equivalents.

Fix comparisons of CMAKE_<LANG>_COMPILER_ID to Clang in CMake's own
source and tests to account for AppleClang.
Add policy CMP0025 for Apple Clang compiler id compatibility

The parent commit introduced a separate "AppleClang" compiler id for
Apple's Clang distribution.  Add a policy in order to support projects
that expect this compiler's id to be just "Clang".  When the policy is
OLD or not set, map AppleClang back to Clang.  Continue to use the
AppleClang id internally while enabling the language, but set the
CMAKE_<LANG>_COMPILER_ID after project() or enable_language() to the
compatible value for use by project code.
Set policy CMP0025 to NEW while building CMake itself

CMake is aware of the policy's NEW behavior and the AppleClang compiler
id.  Set the policy to NEW explicitly to avoid the warning and get the
NEW behavior.

Also teach the RunCMake test infrastructure to build tests with
-DCMAKE_POLICY_DEFAULT_CMP0025=NEW to avoid the policy warning
in test output that must match specific regular expressions.
FindGTK2: Export GTK2_XXX_FOUND to parent scope in _GTK2_FIND_LIBRARY

Also add a debug message to report if the library was found or not
FindGTK2: Populate GTK2_DEFINITIONS before searching for libraries
FindGTK2: Search for glib-object.h instead of gobject/gobject.h

This is the topmost include file for GObject header files
FindGTK2: Create targets for each library

Methods:
 * _GTK2_ADJUST_LIB_VARS
 * _GTK2_ADD_TARGET_DEPENDS_INTERNAL
 * _GTK2_ADD_TARGET_DEPENDS
are strongly inspired by FindQt4.cmake
FindGTK2: Better handling of include directories

Add a method _GTK2_ADD_TARGET_INCLUDE_DIRS to handle it.
FindGTK2: Do not require the GTK_ prefix in all the internal functions

This saves from using string(REGEXP) to create targets
FindGTK2: Small cleanup
unset: Add PARENT_SCOPE option

Add an unset() command option to remove a variable from the calling
scope, just like the set() command's PARENT_SCOPE option.  Teach the
Unset test to cover such cases.
KWSys 2013-10-08 (96b2f6f4)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ 96b2f6f4 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' deec6b8a..96b2f6f4
Adrien Destugues (2):
      2b303bd7 SystemTools: Remove outdated preprocessor checks for Haiku
      96b2f6f4 DynamicLoader: Cleanup test include files for Haiku

Rolf Eike Beer (1):
      dbc8fa1b SystemInformation: fix truncation warnings

Change-Id: I25364f58d62dd73fde0f7625d9d77ed0d4726e33
Merge branch 'upstream-kwsys' into update-kwsys
Haiku: Several fixes to platform module

* Do not define BEOS anymore (this includes workarounds which we don't
  need most of the time in Haiku, so we prefer opt-in IF(HAIKU) in the
  cmake files instead).
* On the other hand, do define UNIX (we are trying to be compliant) and
  HAIKU (there is still a number of things we don't do like the
  average UNIX clone)
* Do not use UnixPaths, as our filesystem hierarchy isn't anything like
  what it expects.
* Do not use -nostart, which the compiler doesn't know about anymore.
  This used to be an Haiku extension to gcc, and is equivalent to
  -shared which is the default gcc option.
* While "dl" functions are provided in libroot, this is always
  implicitly linked so there is no need to tell cmake about it.
* Forcing position-independent code is not needed, so remove it.
* On the other hand, include appropriate linker options for executables
  and shared libraries.
* Support for the two available compilers in Haiku (gcc2 and gcc4) and
  pick the right headers and libraries according to the currently
  selected one.
* With the adoption of the package manager, the directory layout was
  changed. Tell cmake where to look for header files and libraries.
* As we don't define BEOS anymore, enable the workaround we still need
  for HAIKU as well. This is the lack of a libm (it is part of the
  implicitly linked in libroot)

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
Haiku: Remove use of B_COMMON_DIRECTORY

The common directory was removed in Haiku. Applications are now
installed in the system directory.

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
Haiku: Remove outdated preprocessor checks

* Haiku does not define __BEOS__ anymore, so there is no need to guard
  these BeOS specific workaround for Haiku.
* The workaround themselves are not needed for Haiku as it has much
  better POSIX compatibility than BeOS did.

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
Haiku: Include files cleanup in cmCTest

* No need to use a different path from the BeOS one, which still works.

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
FindBLAS: Fixes for Windows MKL support
FindSDL: Add path suffixes for <prefix>/include/(SDL|SDL12|SDL11)

Also add a comment explaining the purpose of the include/SDL* path
suffixes.  As explained in commit 7cb51739 (FindSDL: Restore
accidentally dropped search paths (#13651), 2012-11-05) the include/SDL*
path suffixes are for looking in the ENV{SDLDIR} location.

Inspired-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
FindGTK2: Link freetype libs to targets including freetype includes