cmSourceFileLocation: Avoid string allocation in extension checking

The substr call was causing excess allocations. Swap the cheaper
character check to be before the longer string comparison, now using the
prefix checking function.
cmSourceFileLocation: Simplify logic in Matches
cmSourceFileLocation: Save some string copies
cmSourceFileLocation: Return a string reference
cmSourceFile: Cache the isUiFile check

The filename extension call is expensive, so cache the .ui check.
perf: Cache the language property string
cmSourceFile: Take a string
ClearMatches: Only clear matches which were actually set

ClearMatches was clearing many variables which were never set in the
first place. Instead, store how many matches were made last time and
only clear those. It is moved to the cmMakefile class since it is a
common utility used by multiple commands.
ClearMatches: Store match variable names statically

Constructing the names and then turning them into a std::string is
non-negligible in performance testing.
StoreMatches: Minor cleanups
ninja: Use string parameters
ninja: Don't use a stringstream to build an argument list

Streams are expensive to construct (looks like some locale-related
stuff), so use strings instead.
ExternalProject: Set LABELS property to targets

This is useful for using CDash subprojects.
ExternalProject: Set FOLDER property to targets

This is useful when using the USE_FOLDERS global property
KWSys 2014-05-05 (f3a36760)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ f3a36760 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 8b085635..f3a36760
Brad King (2):
      1979c02d hashtable: Poison operator= on internal node type
      f3a36760 SystemInformation: Include backtrace APIs whenever we use them

Change-Id: Ic90b29e4fbae139ab6c8bd7355661759153e0aa7
Merge branch 'upstream-kwsys' into update-kwsys
InstallRequiredSystemLibraries: MBCS MFC is optional on VS 12 (#14903)

The MBCS (Multi-Byte Character Set) has been deprecated with VS 2013,
and MSVC no longer ships with an MBCS-version of MFC by default.
However, it can be downloaded as an add-on.

Teach InstallRequiredSystemLibraries to install the MBCS MFC only
for VS < 12 or if it happens to exist on the system.
Merge branch 'InstallRequiredSystemLibraries-vs12-mfc' into release
KWSys SystemInformation: Include backtrace APIs whenever we use them

Include execinfo.h, cxxabi.h, and dlfcn.h under the same conditions
under which we use the APIs from them.  Move their inclusion out of
OS-specific blocks.
Merge branch 'backport-kwsys-compile-fix' into release