ExternalProject: Simplify CMake command line generation

Append the source directory to the command line option in a separate
step instead of duplicating it with each possible generator.
Tests: Run ctest custom commands with VERBATIM
Merge branch 'xcode-duplicate-flags-13354' into generator-toolset
Normalize full paths in implicit link library list

Teach CMakeParseImplicitLinkInfo to convert implicit link library full
paths to a canonical form.  This makes them more reproducible in case
different language compiler front-ends add the same library by different
paths e.g. ".../libA.a" and "...//libA.a".

Add a case to the CMake.ImplicitLinkInfo test to cover removal of extra
slashes from both library and directory paths.
Style: Use this-> when invoking member functions.
KWSys 2013-02-05 (5c34ed2e)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ 5c34ed2e | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 5b0d1bd9..5c34ed2e
Brad King (1):
      5c34ed2e SystemTools: Do not abort with no current directory

Change-Id: Id054017eac2bf10c71ca721df48298cdff2bea82
Merge branch 'upstream-kwsys' into update-kwsys
Fail early if no current working directory exists

Remove the old "nocwd" behavior that attempts to provide the "--help"
output when no working directory is available.  The long help output
scrolls the real error message out of typical terminal sizes.  Also
execute as little code as possible when no working directory exists.
CMake: Add -T option to choose a generator toolset

Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_TOOLSET and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases.
Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is
rejected when the generator doesn't support it, and that two -T options
are always rejected.
VS: Implement generator toolset selection (#10722, #13774)

Implement generator toolset selection (cmake -T) for VS >= 10 by setting
the PlatformToolset.  Extend the RunCMake.GeneratorToolset test case to
verify CMAKE_GENERATOR_TOOLSET when the generator supports -T.

Since commit 485a940e (VS: Simplify MSVC version reporting, 2012-08-23)
all MSVC version information is detected during the compiler id step
from the actual compiler invoked by generated build systems rather than
hard-coded in VS generators.  Therefore we can set the PlatformToolset
in VS >= 10 project files and support toolsets from other VS versions.
Xcode: Implement generator toolset selection (#9831, #13802)

Implement generator toolset selection (cmake -T) for Xcode > 2.0 by
adding the GCC_VERSION build setting to project files.
CTest: Add options to set generator toolset

The ctest_configure command already reads the CTEST_CMAKE_GENERATOR
variable to get the value for the cmake -G option.  Read new variable
CTEST_CMAKE_GENERATOR_TOOLSET for -T.

The "ctest --build-and-test" mode already has "--build-generator" to
specify the -G option to CMake.  Add a "--build-generator-toolset" option
to specify the -T value.
ExternalProject: Propagate the generator toolset

When the CMAKE_GENERATOR option is given to ExternalProject_Add, look
also for option CMAKE_GENERATOR_TOOLSET to select the value of the cmake
"-T" command-line flag.  When no CMAKE_GENERATOR option is given
explicitly then use the current project's CMAKE_GENERATOR_TOOLSET (since
we already use its CMAKE_GENERATOR).
Merge branch 'master' into generator-toolset

We need the latest Tests/CMakeLists.txt so we can refactor all tests.
Tests: Consolidate ctest --build-and-test generator options

All ctest --build-and-test invocations require the options

  --build-generator ${CMAKE_GENERATOR}
  --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}

to be passed and have consistent values, except for a few special cases.
Collect the generator options in a variable instead of repeating the
options everywhere explicitly.
Tests: Add generator toolset support

Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
MSVC: Fix CMAKE_CL_64 in CXX-only projects (#13896)

When CXX is enabled without C then MSVC_CXX_ARCHITECTURE_ID is set
instead but not MSVC_C_ARCHITECTURE_ID.  Test both.
Merge topic 'implicit-lib-canonical-path'

10e8b2d Normalize full paths in implicit link library list
Merge topic 'update-kwsys'

7df291f Merge branch 'upstream-kwsys' into update-kwsys
9d66f74 KWSys 2013-02-05 (5c34ed2e)
Merge topic 'exit-without-working-directory'

a943b5c Fail early if no current working directory exists