Merge branch 'xerces-rename' into release
diff --git a/Help/command/file.rst b/Help/command/file.rst
index dbc4149..5d3c4a9 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -247,7 +247,9 @@
 
 ::
 
-  file(GENERATE <options>...)
+  file(GENERATE OUTPUT output-file
+       <INPUT input-file|CONTENT content>
+       [CONDITION expression])
 
 Generate an output file for each build configuration supported by the current
 :manual:`CMake Generator <cmake-generators(7)>`.  Evaluate
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index c2937be..632ece6 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -10,6 +10,7 @@
                 DIRECTORY [dir]    |
                 TARGET    <target> |
                 SOURCE    <source> |
+                INSTALL   <file>   |
                 TEST      <test>   |
                 CACHE     <entry>  |
                 VARIABLE>
@@ -21,29 +22,40 @@
 argument determines the scope from which to get the property.  It must
 be one of the following:
 
-GLOBAL scope is unique and does not accept a name.
+``GLOBAL``
+  Scope is unique and does not accept a name.
 
-DIRECTORY scope defaults to the current directory but another
-directory (already processed by CMake) may be named by full or
-relative path.
+``DIRECTORY``
+  Scope defaults to the current directory but another
+  directory (already processed by CMake) may be named by full or
+  relative path.
 
-TARGET scope must name one existing target.
+``TARGET``
+  Scope must name one existing target.
 
-SOURCE scope must name one source file.
+``SOURCE``
+  Scope must name one source file.
 
-TEST scope must name one existing test.
+``INSTALL``
+  Scope must name one installed file path.
 
-CACHE scope must name one cache entry.
+``TEST``
+  Scope must name one existing test.
 
-VARIABLE scope is unique and does not accept a name.
+``CACHE``
+  Scope must name one cache entry.
 
-The required PROPERTY option is immediately followed by the name of
+``VARIABLE``
+  Scope is unique and does not accept a name.
+
+The required ``PROPERTY`` option is immediately followed by the name of
 the property to get.  If the property is not set an empty value is
-returned.  If the SET option is given the variable is set to a boolean
-value indicating whether the property has been set.  If the DEFINED
+returned.  If the ``SET`` option is given the variable is set to a boolean
+value indicating whether the property has been set.  If the ``DEFINED``
 option is given the variable is set to a boolean value indicating
-whether the property has been defined such as with define_property.
-If BRIEF_DOCS or FULL_DOCS is given then the variable is set to a
+whether the property has been defined such as with the
+:command:`define_property` command.
+If ``BRIEF_DOCS`` or ``FULL_DOCS`` is given then the variable is set to a
 string containing documentation for the requested property.  If
 documentation is requested for a property that has not been defined
-NOTFOUND is returned.
+``NOTFOUND`` is returned.
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 4c52abf..5dd5aaa 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -268,7 +268,8 @@
 
 ::
 
-  install([[SCRIPT <file>] [CODE <code>]] [...])
+  install([[SCRIPT <file>] [CODE <code>]]
+          [COMPONENT <component>] [...])
 
 The ``SCRIPT`` form will invoke the given CMake script files during
 installation.  If the script file name is a relative path it will be
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index 8cb963e..6200230 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -9,6 +9,7 @@
                 DIRECTORY [dir]                   |
                 TARGET    [target1 [target2 ...]] |
                 SOURCE    [src1 [src2 ...]]       |
+                INSTALL   [file1 [file2 ...]]     |
                 TEST      [test1 [test2 ...]]     |
                 CACHE     [entry1 [entry2 ...]]>
                [APPEND] [APPEND_STRING]
@@ -18,26 +19,48 @@
 argument determines the scope in which the property is set.  It must
 be one of the following:
 
-GLOBAL scope is unique and does not accept a name.
+``GLOBAL``
+  Scope is unique and does not accept a name.
 
-DIRECTORY scope defaults to the current directory but another
-directory (already processed by CMake) may be named by full or
-relative path.
+``DIRECTORY``
+  Scope defaults to the current directory but another
+  directory (already processed by CMake) may be named by full or
+  relative path.
 
-TARGET scope may name zero or more existing targets.
+``TARGET``
+  Scope may name zero or more existing targets.
 
-SOURCE scope may name zero or more source files.  Note that source
-file properties are visible only to targets added in the same
-directory (CMakeLists.txt).
+``SOURCE``
+  Scope may name zero or more source files.  Note that source
+  file properties are visible only to targets added in the same
+  directory (CMakeLists.txt).
 
-TEST scope may name zero or more existing tests.
+``INSTALL``
+  Scope may name zero or more installed file paths.
+  These are made available to CPack to influence deployment.
 
-CACHE scope must name zero or more cache existing entries.
+  Both the property key and value may use generator expressions.
+  Specific properties may apply to installed files and/or directories.
 
-The required PROPERTY option is immediately followed by the name of
+  Path components have to be separated by forward slashes,
+  must be normalized and are case sensitive.
+
+  To reference the installation prefix itself with a relative path use ".".
+
+  Currently installed file properties are only defined for
+  the WIX generator where the given paths are relative
+  to the installation prefix.
+
+``TEST``
+  Scope may name zero or more existing tests.
+
+``CACHE``
+  Scope must name zero or more cache existing entries.
+
+The required ``PROPERTY`` option is immediately followed by the name of
 the property to set.  Remaining arguments are used to compose the
 property value in the form of a semicolon-separated list.  If the
-APPEND option is given the list is appended to any existing property
-value.If the APPEND_STRING option is given the string is append to any
+``APPEND`` option is given the list is appended to any existing property
+value.  If the ``APPEND_STRING`` option is given the string is append to any
 existing property value as string, i.e.  it results in a longer string
 and not a list of strings.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index 581bace..fd433a8 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -9,8 +9,8 @@
     <INTERFACE|PUBLIC|PRIVATE> [items1...]
     [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
 
-Specify include directories or targets to use when compiling a given
-target.  The named ``<target>`` must have been created by a command such
+Specify include directories to use when compiling a given target.
+The named ``<target>`` must have been created by a command such
 as :command:`add_executable` or :command:`add_library` and must not be an
 :prop_tgt:`IMPORTED` target.
 
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index d6f148d..832240a 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -22,6 +22,10 @@
 following arguments specify sources.  Repeated calls for the same
 ``<target>`` append items in the order called.
 
+Targets with :prop_tgt:`INTERFACE_SOURCES` may not be exported with the
+:command:`export` or :command:`install(EXPORT)` commands. This limitation may be
+lifted in a future version of CMake.
+
 Arguments to ``target_sources`` may use "generator expressions"
 with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
diff --git a/Help/generator/Visual Studio 14.rst b/Help/generator/Visual Studio 14 2015.rst
similarity index 66%
rename from Help/generator/Visual Studio 14.rst
rename to Help/generator/Visual Studio 14 2015.rst
index d621b7e..b35997a 100644
--- a/Help/generator/Visual Studio 14.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -1,7 +1,7 @@
-Visual Studio 14
-----------------
+Visual Studio 14 2015
+---------------------
 
-Generates Visual Studio 14 project files.
+Generates Visual Studio 14 (VS 2015) project files.
 
 The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set
 to specify a target platform name.
@@ -9,8 +9,8 @@
 For compatibility with CMake versions prior to 3.1, one may specify
 a target platform name optionally at the end of this generator name:
 
-``Visual Studio 14 Win64``
+``Visual Studio 14 2015 Win64``
   Specify target platform ``x64``.
 
-``Visual Studio 14 ARM``
+``Visual Studio 14 2015 ARM``
   Specify target platform ``ARM``.
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 4259224..7a6c249 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -28,7 +28,7 @@
 or compile flags needed to use them.
 
 Features known to CMake are named mostly following the same convention
-as the Clang feature test macros.  The are some execptions, such as
+as the Clang feature test macros.  The are some exceptions, such as
 CMake using ``cxx_final`` and ``cxx_override`` instead of the single
 ``cxx_override_control`` used by Clang.
 
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 4bc8c5f..bda7eef 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -64,7 +64,7 @@
    /generator/Visual Studio 10 2010
    /generator/Visual Studio 11 2012
    /generator/Visual Studio 12 2013
-   /generator/Visual Studio 14
+   /generator/Visual Studio 14 2015
    /generator/Xcode
 
 Extra Generators
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index bf456f5..cca6d28 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -291,6 +291,9 @@
    /prop_sf/OBJECT_OUTPUTS
    /prop_sf/SYMBOLIC
    /prop_sf/VS_DEPLOYMENT_CONTENT
+   /prop_sf/VS_DEPLOYMENT_LOCATION
+   /prop_sf/VS_SHADER_ENTRYPOINT
+   /prop_sf/VS_SHADER_MODEL
    /prop_sf/VS_SHADER_TYPE
    /prop_sf/WRAP_EXCLUDE
    /prop_sf/XCODE_EXPLICIT_FILE_TYPE
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index afc8ba2..44ffb3b 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -241,3 +241,20 @@
 
   set(CMAKE_SYSTEM_NAME WindowsStore)
   set(CMAKE_SYSTEM_VERSION 8.1)
+
+Cross Compiling using NVIDIA Nsight Tegra
+-----------------------------------------
+
+A toolchain file to configure a Visual Studio generator to
+build using NVIDIA Nsight Tegra targeting Android may look
+like this:
+
+.. code-block:: cmake
+
+  set(CMAKE_SYSTEM_NAME Android)
+
+The :variable:`CMAKE_GENERATOR_TOOLSET` may be set to select
+the Nsight Tegra "Toolchain Version" value.
+
+See the :prop_tgt:`ANDROID_API` and :prop_tgt:`ANDROID_GUI`
+target properties to configure targets within the project.
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 03e86af..cc132c2 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -58,7 +58,7 @@
  will have no effect.
 
 ``-j <jobs>, --parallel <jobs>``
- Run the tests in parallel using thegiven number of jobs.
+ Run the tests in parallel using the given number of jobs.
 
  This option tells ctest to run the tests in parallel using given
  number of jobs.  This option can also be set by setting the
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
index fac430e..bb0ff8b 100644
--- a/Help/policy/CMP0053.rst
+++ b/Help/policy/CMP0053.rst
@@ -28,7 +28,7 @@
   so improper variable reference syntax is always an error.
 
 * More characters are allowed to be escaped in variable names.
-  Previously, only ``()#" \#@^`` were valid characters to
+  Previously, only ``()#" \@^`` were valid characters to
   escape. Now any non-alphanumeric, non-semicolon, non-NUL
   character may be escaped following the ``escape_identity``
   production in the :ref:`Escape Sequences` section of the
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index bdeabdb..e24822c 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -145,7 +145,7 @@
   .. _N2672: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
 
 ``cxx_generic_lambdas``
-  Generic lambdas, ss defined in N3649_.
+  Generic lambdas, as defined in N3649_.
 
   .. _N3649: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html
 
diff --git a/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst
new file mode 100644
index 0000000..303db95
--- /dev/null
+++ b/Help/prop_sf/VS_DEPLOYMENT_LOCATION.rst
@@ -0,0 +1,8 @@
+VS_DEPLOYMENT_LOCATION
+----------------------
+
+Specifies the deployment location for a content source file with a Windows
+Phone or Windows Store application when built with a Visual Studio generator.
+This property is only applicable when using :prop_sf:`VS_DEPLOYMENT_CONTENT`.
+The value represent the path relative to the app package and applies to all
+configurations.
diff --git a/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst
new file mode 100644
index 0000000..fe3471f
--- /dev/null
+++ b/Help/prop_sf/VS_SHADER_ENTRYPOINT.rst
@@ -0,0 +1,5 @@
+VS_SHADER_ENTRYPOINT
+--------------------
+
+Specifies the name of the entry point for the shader of a ``.hlsl`` source
+file.
diff --git a/Help/prop_sf/VS_SHADER_MODEL.rst b/Help/prop_sf/VS_SHADER_MODEL.rst
new file mode 100644
index 0000000..b1cf0df
--- /dev/null
+++ b/Help/prop_sf/VS_SHADER_MODEL.rst
@@ -0,0 +1,5 @@
+VS_SHADER_MODEL
+---------------
+
+Specifies the shader model of a ``.hlsl`` source file. Some shader types can
+only be used with recent shader models
diff --git a/Help/prop_tgt/ANDROID_GUI.rst b/Help/prop_tgt/ANDROID_GUI.rst
index 90d2428..abdba7a 100644
--- a/Help/prop_tgt/ANDROID_GUI.rst
+++ b/Help/prop_tgt/ANDROID_GUI.rst
@@ -7,3 +7,7 @@
 will be created as an application package.  This property is initialized
 by the value of the :variable:`CMAKE_ANDROID_GUI` variable if it is set
 when a target is created.
+
+Add the ``AndroidManifest.xml`` source file explicitly to the
+target :command:`add_executable` command invocation to specify the
+root directory of the application package source.
diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst
index fb28231..c8ca2e8 100644
--- a/Help/prop_tgt/INTERFACE_SOURCES.rst
+++ b/Help/prop_tgt/INTERFACE_SOURCES.rst
@@ -9,6 +9,10 @@
 such as ``$<TARGET_PROPERTY:foo,INTERFACE_SOURCES>`` to use the
 sources specified in the interface of ``foo``.
 
+Targets with ``INTERFACE_SOURCES`` may not be exported with the
+:command:`export` or :command:`install(EXPORT)` commands. This limitation may be
+lifted in a future version of CMake.
+
 Contents of ``INTERFACE_SOURCES`` may use "generator expressions"
 with the syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
diff --git a/Help/release/3.1.0.rst b/Help/release/3.1.0.rst
index 0cece37..a5b3e8e 100644
--- a/Help/release/3.1.0.rst
+++ b/Help/release/3.1.0.rst
@@ -18,7 +18,7 @@
 Generators
 ----------
 
-* A :generator:`Visual Studio 14` generator was added.
+* The :generator:`Visual Studio 14 2015` generator was added.
 
 Windows Phone and Windows Store
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -69,9 +69,15 @@
   :variable:`CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY`
   variables to skip searching the package registries.
 
+* The :command:`get_property` command learned a new ``INSTALL`` scope
+  for properties.
+
 * The :command:`install` command learned a ``MESSAGE_NEVER`` option
   to avoid output during installation.
 
+* The :command:`set_property` command learned a new ``INSTALL`` scope
+  for properties.
+
 * The :command:`string` command learned a new ``GENEX_STRIP`` subcommand
   which removes
   :manual:`generator expression <cmake-generator-expressions(7)>`.
@@ -159,6 +165,10 @@
   to tell the Visual Studio generators to mark content for deployment
   in Windows Phone and Windows Store projects.
 
+* A :prop_sf:`VS_DEPLOYMENT_LOCATION` source file property was added
+  to tell the Visual Studio generators the relative location of content
+  marked for deployment in Windows Phone and Windows Store projects.
+
 * The :prop_tgt:`VS_WINRT_COMPONENT` target property was created to
   tell Visual Studio generators to compile a shared library as a
   Windows Runtime (WinRT) component.
@@ -230,9 +240,6 @@
 
 * The :module:`FindOpenCL` module was introduced.
 
-* The :module:`FindOpenGL` module now provides imported targets
-  ``OpenGL::GL`` and ``OpenGL::GLU`` when the libraries are found.
-
 * The :module:`FindOpenMP` module learned to support Fortran.
 
 * The :module:`FindPkgConfig` module learned to use the ``PKG_CONFIG``
@@ -312,8 +319,10 @@
 
 * The Visual Studio generators learned to treat ``.hlsl`` source
   files as High Level Shading Language sources (using ``FXCompile``
-  in ``.vcxproj`` files).  A :prop_sf:`VS_SHADER_TYPE` source file
-  property was added to specify the Shader Type.
+  in ``.vcxproj`` files).  Source file properties
+  :prop_sf:`VS_SHADER_TYPE`, :prop_sf:`VS_SHADER_MODEL`, and
+  :prop_sf:`VS_SHADER_ENTRYPOINT` were added added to specify the
+  shader type, model, and entry point name.
 
 New Diagnostics
 ===============
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index e0ba131..376a6dc 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -30,12 +30,12 @@
 #  License text for the above reference.)
 
 # if it's the MS C/CXX compiler, search for link
-if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC"
-   OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC"
-   OR "${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "MSVC"
-   OR "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"
-   OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"
-   OR ("${CMAKE_GENERATOR}" MATCHES "Visual Studio"
+if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
+   OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+   OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC"
+   OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC"
+   OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC"
+   OR (CMAKE_GENERATOR MATCHES "Visual Studio"
        AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android"))
 
   find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index bfcf455..fcc13da 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -66,7 +66,8 @@
           set(log "${log}    arg [${arg}] ==> dir [${dir}]\n")
         elseif("${arg}" MATCHES "^-l([^:].*)$")
           # Unix library.
-          list(APPEND implicit_libs_tmp ${CMAKE_MATCH_1})
+          set(lib "${CMAKE_MATCH_1}")
+          list(APPEND implicit_libs_tmp ${lib})
           set(log "${log}    arg [${arg}] ==> lib [${lib}]\n")
         elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.a$")
           # Unix library full path.
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 6f2eeb3..e5b7601 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -14,19 +14,19 @@
 # Overview
 # ^^^^^^^^
 #
-# CPack ``IFW`` generator helps you create online and offline
+# CPack ``IFW`` generator helps you to create online and offline
 # binary cross-platform installers with a graphical user interface.
 #
-# CPack IFW generator prepare project installation and generate configuration
+# CPack IFW generator prepares project installation and generates configuration
 # and meta information for QtIFW_ tools.
 #
 # The QtIFW_ provides a set of tools and utilities to create
 # installers for the supported desktop Qt platforms: Linux, Microsoft Windows,
 # and Mac OS X.
 #
-# To use CPack ``IFW`` generator you must also install QtIFW_.
-# If you are not using the default path for the installation, please set
-# the path to the variable ``QTIFWDIR``.
+# You should also install QtIFW_ to use CPack ``IFW`` generator.
+# If you don't use a default path for the installation, please set
+# the used path in the variable ``QTIFWDIR``.
 #
 # Variables
 # ^^^^^^^^^
@@ -61,7 +61,7 @@
 #
 # .. variable:: CPACK_IFW_PACKAGE_LOGO
 #
-#  Filename for a logo used as QWizard::LogoPixmap.
+#  Filename for a logo is used as QWizard::LogoPixmap.
 #
 # .. variable:: CPACK_IFW_TARGET_DIRECTORY
 #
@@ -149,12 +149,12 @@
 # This command should be called after cpack_add_component command.
 #
 # ``COMMON`` if set, then the component will be packaged and installed as part
-# of a group to which he belongs.
+# of a group to which it belongs.
 #
 # ``VERSION`` is version of component.
 # By default used :variable:`CPACK_PACKAGE_VERSION`.
 #
-# ``SCRIPT`` is relative or absolute path to operations script
+# ``SCRIPT`` is a relative or absolute path to operations script
 # for this component.
 #
 # ``NAME`` is used to create domain-like identification for this component.
@@ -190,7 +190,7 @@
 # ``NAME`` is used to create domain-like identification for this component group.
 # By default used origin component group name.
 #
-# ``SCRIPT`` is relative or absolute path to operations script
+# ``SCRIPT`` is a relative or absolute path to operations script
 # for this component group.
 #
 # ``PRIORITY`` is priority of the component group in the tree.
@@ -255,7 +255,7 @@
 # Online installer
 # ^^^^^^^^^^^^^^^^
 #
-# By defaul CPack IFW generator make offline installer. This means that all
+# By default CPack IFW generator makes offline installer. This means that all
 # components will be packaged into a binary file.
 #
 # To make a component downloaded, you must set the ``DOWNLOADED`` option in
@@ -267,7 +267,7 @@
 # You also can use command :command:`cpack_ifw_add_repository` and
 # variable :variable:`CPACK_IFW_DOWNLOAD_ALL` for more specific configuration.
 #
-# CPack IFW generator create "repository" dir in current binary dir. You
+# CPack IFW generator creates "repository" dir in current binary dir. You
 # would copy content of this dir to specified ``site`` (``url``).
 #
 # See Also
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 44070b8..98fcd0b 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1 +1,2 @@
-include(Compiler/Clang-C)
+include(Compiler/Clang)
+__compiler_clang(C)
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 0372e18..c1acae6 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -1,6 +1,6 @@
 include(Compiler/Clang)
 __compiler_clang(CXX)
 
-if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
diff --git a/Modules/Compiler/Clang-C-FeatureTests.cmake b/Modules/Compiler/Clang-C-FeatureTests.cmake
index 4a72e87..2d8673d 100644
--- a/Modules/Compiler/Clang-C-FeatureTests.cmake
+++ b/Modules/Compiler/Clang-C-FeatureTests.cmake
@@ -1,9 +1,9 @@
 
 set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 304")
 
-set(Clang_C11 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 201112L")
+set(Clang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
 set(_cmake_feature_test_c_static_assert "${Clang_C11}")
-set(Clang_C99 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 199901L")
+set(Clang_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
 set(_cmake_feature_test_c_restrict "${Clang_C99}")
 set(_cmake_feature_test_c_variadic_macros "${Clang_C99}")
 
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 05d3c0b..d504d69 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -6,7 +6,7 @@
   return()
 endif()
 
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
   set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
   set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
 
@@ -17,14 +17,18 @@
   set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
 endif()
 
-set(CMAKE_C_STANDARD_DEFAULT 90)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6)
+  set(CMAKE_C_STANDARD_DEFAULT 11)
+elseif(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
+  set(CMAKE_C_STANDARD_DEFAULT 99)
+endif()
 
 macro(cmake_record_c_compile_features)
   macro(_get_clang_features std_version list)
     record_compiler_features(C "-std=${std_version}" ${list})
   endmacro()
 
-  if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+  if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
     _get_clang_features(c11 CMAKE_C11_COMPILE_FEATURES)
     if (_result EQUAL 0)
       _get_clang_features(c99 CMAKE_C99_COMPILE_FEATURES)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 5dd7b4a..9ef1413 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1,7 +1,7 @@
 include(Compiler/Clang)
 __compiler_clang(CXX)
 
-if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
 
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index eeba119..701089c 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -18,8 +18,8 @@
 endif()
 set(__COMPILER_CLANG 1)
 
-if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC"
-    OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
+    OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   macro(__compiler_clang lang)
   endmacro()
 else()
diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake
index dc1695c..dfaeebf 100644
--- a/Modules/Compiler/GNU-C-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-C-FeatureTests.cmake
@@ -1,10 +1,10 @@
 
 set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407")
 
-set(GNU46_C11 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 201112L")
+set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
 set(_cmake_feature_test_c_static_assert "${GNU46_C11}")
 # Since 4.4 at least:
-set(GNU44_C99 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 199901L")
+set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
 set(_cmake_feature_test_c_restrict "${GNU44_C99}")
 set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}")
 
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 35954be..24d439d 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -12,8 +12,11 @@
   set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
 endif()
 
-# This may change in a future GNU version.
-set(CMAKE_C_STANDARD_DEFAULT 90)
+if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
+  set(CMAKE_C_STANDARD_DEFAULT 11)
+else(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
+  set(CMAKE_C_STANDARD_DEFAULT 90)
+endif()
 
 macro(cmake_record_c_compile_features)
   macro(_get_gcc_features std_version list)
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index 14dc76a..4129a38 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -11,7 +11,8 @@
   endif()
 endif()
 
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
+  # Supported since 4.3
   set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
   set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
 endif()
@@ -19,9 +20,7 @@
 if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
   set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
   set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
-elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
-  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
-  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
+  # 4.3 supports 0x variants
 endif()
 
 if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 79be34e..bb73853 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -115,7 +115,10 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE
       ERROR_STRIP_TRAILING_WHITESPACE)
     if( res )
-      if(${Java_FIND_REQUIRED})
+      if(var MATCHES "No Java runtime present, requesting install")
+        set_property(CACHE Java_JAVA_EXECUTABLE
+          PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND")
+      elseif(${Java_FIND_REQUIRED})
         message( FATAL_ERROR "Error executing java -version" )
       else()
         message( STATUS "Warning, could not run java -version")
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 2b3bd14..a83a6c3 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -4,16 +4,6 @@
 #
 # FindModule for OpenGL and GLU.
 #
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` targets:
-#
-# ``OpenGL::GL``
-#  Defined if the system has OpenGL.
-# ``OpenGL::GLU``
-#  Defined if the system has GLU.
-#
 # Result Variables
 # ^^^^^^^^^^^^^^^^
 #
@@ -191,36 +181,6 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS})
 unset(_OpenGL_REQUIRED_VARS)
 
-# OpenGL:: targets
-if(OPENGL_FOUND)
-  if(NOT TARGET OpenGL::GL)
-    add_library(OpenGL::GL UNKNOWN IMPORTED)
-    set_target_properties(OpenGL::GL PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}")
-    if(OPENGL_gl_LIBRARY MATCHES "/([^/]+)\\.framework$")
-      set_target_properties(OpenGL::GL PROPERTIES
-        IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}/${CMAKE_MATCH_1}")
-    else()
-      set_target_properties(OpenGL::GL PROPERTIES
-        IMPORTED_LOCATION "${OPENGL_gl_LIBRARY}")
-    endif()
-  endif()
-
-  if(OPENGL_GLU_FOUND AND NOT TARGET OpenGL::GLU)
-    add_library(OpenGL::GLU UNKNOWN IMPORTED)
-    set_target_properties(OpenGL::GLU PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
-      INTERFACE_LINK_LIBRARIES OpenGL::GL)
-    if(OPENGL_glu_LIBRARY MATCHES "/([^/]+)\\.framework$")
-      set_target_properties(OpenGL::GLU PROPERTIES
-        IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}/${CMAKE_MATCH_1}")
-    else()
-      set_target_properties(OpenGL::GLU PROPERTIES
-        IMPORTED_LOCATION "${OPENGL_glu_LIBRARY}")
-    endif()
-  endif()
-endif()
-
 mark_as_advanced(
   OPENGL_INCLUDE_DIR
   OPENGL_xmesa_INCLUDE_DIR
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 801b4f8..a102c66 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -111,11 +111,11 @@
 # same in Fortran
 set(OpenMP_Fortran_TEST_SOURCE
   "
-program test
-use omp_lib
-integer :: n
-n = omp_get_num_threads()
-end program test
+      program test
+      use omp_lib
+      integer :: n
+      n = omp_get_num_threads()
+      end program test
   "
   )
 
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 5e5c7b9..8784e18 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -148,8 +148,8 @@
             # this is older.
             set(PYTHON_VERSION_STRING "1.4")
             set(PYTHON_VERSION_MAJOR "1")
-            set(PYTHON_VERSION_MAJOR "4")
-            set(PYTHON_VERSION_MAJOR "0")
+            set(PYTHON_VERSION_MINOR "4")
+            set(PYTHON_VERSION_PATCH "0")
         endif()
     endif()
     unset(_PYTHON_VERSION_RESULT)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 7ef06a8..dec0ddf 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -460,6 +460,8 @@
       D:/
       ENV ProgramFiles
     PATH_SUFFIXES
+      wxWidgets-3.0.2
+      wxWidgets-3.0.1
       wxWidgets-3.0.0
       wxWidgets-2.9.5
       wxWidgets-2.9.4
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 4c936fe..da19a3d 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -18,8 +18,8 @@
 endif()
 set(__WINDOWS_CLANG 1)
 
-if(CMAKE_C_SIMULATE_ID STREQUAL "MSVC"
-    OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
+if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
+    OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
   include(Platform/Windows-MSVC)
   macro(__windows_compiler_clang lang)
     __windows_compiler_msvc(${lang})
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 86137e2..8d72d0f 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -72,7 +72,7 @@
 #    write_compiler_detection_header(
 #      FILE climbingstats_compiler_detection.h
 #      PREFIX ClimbingStats
-#      COMPILERS GNU Clang MSVC
+#      COMPILERS GNU Clang
 #      FEATURES cxx_variadic_templates
 #    )
 #
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index aba26de..6065b8a 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -11,6 +11,7 @@
 ============================================================================*/
 
 #include "cmConditionEvaluator.h"
+#include "cmStringCommand.h"
 
 cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile):
   Makefile(makefile),
@@ -555,7 +556,7 @@
         {
         def = this->GetVariableOrString(*arg);
         const char* rex = argP2->c_str();
-        this->Makefile.ClearMatches();
+        cmStringCommand::ClearMatches(&this->Makefile);
         cmsys::RegularExpression regEntry;
         if ( !regEntry.compile(rex) )
           {
@@ -567,7 +568,7 @@
           }
         if (regEntry.find(def))
           {
-          this->Makefile.StoreMatches(regEntry);
+          cmStringCommand::StoreMatches(&this->Makefile, regEntry);
           *arg = cmExpandedCommandArgument("1", true);
           }
         else
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 30a52d4..134ee98 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -68,6 +68,16 @@
       tei != this->Exports.end(); ++tei)
     {
     cmTarget* te = *tei;
+    if (te->GetProperty("INTERFACE_SOURCES"))
+      {
+      cmOStringStream e;
+      e << "Target \""
+        << te->GetName()
+        << "\" has a populated INTERFACE_SOURCES property.  This is not "
+          "currently supported.";
+      cmSystemTools::Error(e.str().c_str());
+      return false;
+      }
     this->GenerateImportTargetCode(os, te);
 
     te->AppendBuildInterfaceIncludes();
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 89071c0..23180f1 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -123,6 +123,17 @@
     {
     cmTarget* te = (*tei)->Target;
 
+    if (te->GetProperty("INTERFACE_SOURCES"))
+      {
+      cmOStringStream e;
+      e << "Target \""
+        << te->GetName()
+        << "\" has a populated INTERFACE_SOURCES property.  This is not "
+          "currently supported.";
+      cmSystemTools::Error(e.str().c_str());
+      return false;
+      }
+
     requiresConfigFiles = requiresConfigFiles
                               || te->GetType() != cmTarget::INTERFACE_LIBRARY;
 
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 67a1a6d..84a4daa 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -69,9 +69,42 @@
                                const GeneratorExpressionContent *content,
                                cmGeneratorExpressionDAGChecker *dagChecker
                               ) const = 0;
+
+  static std::string EvaluateDependentExpression(
+    std::string const& prop, cmMakefile *makefile,
+    cmGeneratorExpressionContext *context,
+    cmTarget const* headTarget, cmTarget const* currentTarget,
+    cmGeneratorExpressionDAGChecker *dagChecker);
 };
 
 //----------------------------------------------------------------------------
+std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
+    std::string const& prop, cmMakefile *makefile,
+    cmGeneratorExpressionContext *context,
+    cmTarget const* headTarget, cmTarget const* currentTarget,
+    cmGeneratorExpressionDAGChecker *dagChecker)
+{
+  cmGeneratorExpression ge(&context->Backtrace);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+  cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
+  std::string result = cge->Evaluate(makefile,
+                        context->Config,
+                        context->Quiet,
+                        headTarget,
+                        currentTarget,
+                        dagChecker);
+  if (cge->GetHadContextSensitiveCondition())
+    {
+    context->HadContextSensitiveCondition = true;
+    }
+  if (cge->GetHadHeadSensitiveCondition())
+    {
+    context->HadHeadSensitiveCondition = true;
+    }
+  return result;
+}
+
+//----------------------------------------------------------------------------
 static const struct ZeroNode : public cmGeneratorExpressionNode
 {
   ZeroNode() {}
@@ -825,22 +858,10 @@
     }
   if(!depString.empty())
     {
-    cmGeneratorExpression ge(&context->Backtrace);
-    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(depString);
-    linkedTargetsContent = cge->Evaluate(target->GetMakefile(),
-                                         context->Config,
-                                         context->Quiet,
-                                         headTarget,
-                                         target,
-                                         dagChecker);
-    if (cge->GetHadContextSensitiveCondition())
-      {
-      context->HadContextSensitiveCondition = true;
-      }
-    if (cge->GetHadHeadSensitiveCondition())
-      {
-      context->HadHeadSensitiveCondition = true;
-      }
+    linkedTargetsContent =
+        cmGeneratorExpressionNode::EvaluateDependentExpression(depString,
+                                        target->GetMakefile(), context,
+                                        headTarget, target, dagChecker);
     }
   linkedTargetsContent =
     cmGeneratorExpression::StripEmptyListElements(linkedTargetsContent);
@@ -1181,24 +1202,9 @@
       }
     if(!interfacePropertyName.empty())
       {
-      cmGeneratorExpression ge(&context->Backtrace);
-      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-      cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
-      std::string result = cge->Evaluate(context->Makefile,
-                            context->Config,
-                            context->Quiet,
-                            headTarget,
-                            target,
-                            &dagChecker);
-
-      if (cge->GetHadContextSensitiveCondition())
-        {
-        context->HadContextSensitiveCondition = true;
-        }
-      if (cge->GetHadHeadSensitiveCondition())
-        {
-        context->HadHeadSensitiveCondition = true;
-        }
+      std::string result = this->EvaluateDependentExpression(prop,
+                                        context->Makefile, context,
+                                        headTarget, target, &dagChecker);
       if (!linkedTargetsContent.empty())
         {
         result += (result.empty() ? "" : ";") + linkedTargetsContent;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ae0e807..2f4d9bb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2362,7 +2362,8 @@
         depends.push_back(this->GetAllTargetName());
         }
       }
-    if(mf->GetDefinition("CMake_BINARY_DIR"))
+    if(mf->GetDefinition("CMake_BINARY_DIR") &&
+       !mf->IsOn("CMAKE_CROSSCOMPILING"))
       {
       // We are building CMake itself.  We cannot use the original
       // executable to install over itself.  The generator will
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index d70d2af..499ac56 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -262,6 +262,24 @@
 }
 
 //----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(
+  std::string& toolset) const
+{
+  toolset = "";
+  return false;
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(
+  std::string& toolset) const
+{
+  toolset = "";
+  return false;
+}
+
+//----------------------------------------------------------------------------
 std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const
 {
   if (this->SystemVersion == "8.0")
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 686dcdf..3b0a5cf 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -118,9 +118,10 @@
   virtual bool InitializeWindowsCE(cmMakefile* mf);
   virtual bool InitializeWindowsPhone(cmMakefile* mf);
   virtual bool InitializeWindowsStore(cmMakefile* mf);
+
   virtual std::string SelectWindowsCEToolset() const;
-  virtual std::string SelectWindowsPhoneToolset() const { return ""; }
-  virtual std::string SelectWindowsStoreToolset() const { return ""; }
+  virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
+  virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
 
   virtual const char* GetIDEVersion() { return "10.0"; }
 
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index 39bbdc0..2b69222 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -131,12 +131,20 @@
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf)
 {
-  this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset();
-  if(this->DefaultPlatformToolset.empty())
+  if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset))
     {
     cmOStringStream e;
-    e << this->GetName() << " supports Windows Phone '8.0', but not '"
-      << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+    if(this->DefaultPlatformToolset.empty())
+      {
+      e << this->GetName() << " supports Windows Phone '8.0', but not '"
+        << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+      }
+    else
+      {
+      e << "A Windows Phone component with CMake requires both the Windows "
+        << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
+        << "' SDK. Please make sure that you have both installed";
+      }
     mf->IssueMessage(cmake::FATAL_ERROR, e.str());
     return false;
     }
@@ -146,12 +154,20 @@
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf)
 {
-  this->DefaultPlatformToolset = this->SelectWindowsStoreToolset();
-  if(this->DefaultPlatformToolset.empty())
+  if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
     {
     cmOStringStream e;
-    e << this->GetName() << " supports Windows Store '8.0', but not '"
-      << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+    if(this->DefaultPlatformToolset.empty())
+      {
+      e << this->GetName() << " supports Windows Store '8.0', but not '"
+        << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+      }
+    else
+      {
+      e << "A Windows Store component with CMake requires both the Windows "
+        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+        << "' SDK. Please make sure that you have both installed";
+      }
     mf->IssueMessage(cmake::FATAL_ERROR, e.str());
     return false;
     }
@@ -159,23 +175,47 @@
 }
 
 //----------------------------------------------------------------------------
-std::string cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset() const
+bool
+cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(
+  std::string& toolset) const
 {
   if(this->SystemVersion == "8.0")
     {
-    return "v110_wp80";
+    if (this->IsWindowsPhoneToolsetInstalled() &&
+        this->IsWindowsDesktopToolsetInstalled())
+      {
+      toolset = "v110_wp80";
+      return true;
+      }
+    else
+      {
+      return false;
+      }
     }
-  return this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset();
+  return
+    this->cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(toolset);
 }
 
 //----------------------------------------------------------------------------
-std::string cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset() const
+bool
+cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(
+  std::string& toolset) const
 {
   if(this->SystemVersion == "8.0")
     {
-    return "v110";
+    if(this->IsWindowsStoreToolsetInstalled() &&
+       this->IsWindowsDesktopToolsetInstalled())
+      {
+      toolset = "v110";
+      return true;
+      }
+    else
+      {
+      return false;
+      }
     }
-  return this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset();
+  return
+    this->cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(toolset);
 }
 
 //----------------------------------------------------------------------------
@@ -256,3 +296,54 @@
     }
   return cmGlobalVisualStudio10Generator::NeedsDeploy(type);
 }
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio11Generator::IsWindowsDesktopToolsetInstalled() const
+{
+  const char desktop80Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "VisualStudio\\11.0\\VC\\Libraries\\Extended";
+  const char VS2012DesktopExpressKey[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "WDExpress\\11.0;InstallDir";
+
+  std::vector<std::string> subkeys;
+  std::string path;
+  return cmSystemTools::ReadRegistryValue(VS2012DesktopExpressKey,
+                                          path,
+                                          cmSystemTools::KeyWOW64_32) ||
+         cmSystemTools::GetRegistrySubKeys(desktop80Key,
+                                           subkeys,
+                                           cmSystemTools::KeyWOW64_32);
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio11Generator::IsWindowsPhoneToolsetInstalled() const
+{
+  const char wp80Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "Microsoft SDKs\\WindowsPhone\\v8.0\\"
+    "Install Path;Install Path";
+
+  std::string path;
+  cmSystemTools::ReadRegistryValue(wp80Key,
+                                   path,
+                                   cmSystemTools::KeyWOW64_32);
+  return !path.empty();
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio11Generator::IsWindowsStoreToolsetInstalled() const
+{
+  const char win80Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "VisualStudio\\11.0\\VC\\Libraries\\Core\\Arm";
+
+  std::vector<std::string> subkeys;
+  return cmSystemTools::GetRegistrySubKeys(win80Key,
+                                           subkeys,
+                                           cmSystemTools::KeyWOW64_32);
+}
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index bbd935c..c79dc97 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -36,8 +36,15 @@
 protected:
   virtual bool InitializeWindowsPhone(cmMakefile* mf);
   virtual bool InitializeWindowsStore(cmMakefile* mf);
-  virtual std::string SelectWindowsPhoneToolset() const;
-  virtual std::string SelectWindowsStoreToolset() const;
+  virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
+  virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
+
+  // These aren't virtual because we need to check if the selected version
+  // of the toolset is installed
+  bool IsWindowsDesktopToolsetInstalled() const;
+  bool IsWindowsPhoneToolsetInstalled() const;
+  bool IsWindowsStoreToolsetInstalled() const;
+
   virtual const char* GetIDEVersion() { return "11.0"; }
   bool UseFolderProperty();
   static std::set<std::string> GetInstalledWindowsCESDKs();
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 29ecfe0..047f2ad 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -111,12 +111,20 @@
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf)
 {
-  this->DefaultPlatformToolset = this->SelectWindowsPhoneToolset();
-  if(this->DefaultPlatformToolset.empty())
+  if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset))
     {
     cmOStringStream e;
-    e << this->GetName() << " supports Windows Phone '8.0' and '8.1', "
-      "but not '" << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+    if(this->DefaultPlatformToolset.empty())
+      {
+      e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but "
+        "not '" << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+      }
+    else
+      {
+      e << "A Windows Phone component with CMake requires both the Windows "
+        << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
+        << "' SDK. Please make sure that you have both installed";
+      }
     mf->IssueMessage(cmake::FATAL_ERROR, e.str());
     return false;
     }
@@ -126,12 +134,20 @@
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf)
 {
-  this->DefaultPlatformToolset = this->SelectWindowsStoreToolset();
-  if(this->DefaultPlatformToolset.empty())
+  if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
     {
     cmOStringStream e;
-    e << this->GetName() << " supports Windows Store '8.0' and '8.1', "
-      "but not '" << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+    if(this->DefaultPlatformToolset.empty())
+      {
+      e << this->GetName() << " supports Windows Store '8.0' and '8.1', but "
+        "not '" << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
+      }
+    else
+      {
+      e << "A Windows Store component with CMake requires both the Windows "
+        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+        << "' SDK. Please make sure that you have both installed";
+      }
     mf->IssueMessage(cmake::FATAL_ERROR, e.str());
     return false;
     }
@@ -139,23 +155,47 @@
 }
 
 //----------------------------------------------------------------------------
-std::string cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset() const
+bool
+cmGlobalVisualStudio12Generator::SelectWindowsPhoneToolset(
+  std::string& toolset) const
 {
   if(this->SystemVersion == "8.1")
     {
-    return "v120_wp81";
+    if (this->IsWindowsPhoneToolsetInstalled() &&
+        this->IsWindowsDesktopToolsetInstalled())
+      {
+      toolset = "v120_wp81";
+      return true;
+      }
+    else
+      {
+      return false;
+      }
     }
-  return this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset();
+  return
+    this->cmGlobalVisualStudio11Generator::SelectWindowsPhoneToolset(toolset);
 }
 
 //----------------------------------------------------------------------------
-std::string cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset() const
+bool
+cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(
+  std::string& toolset) const
 {
   if(this->SystemVersion == "8.1")
     {
-    return "v120";
+    if(this->IsWindowsStoreToolsetInstalled() &&
+       this->IsWindowsDesktopToolsetInstalled())
+      {
+      toolset = "v120";
+      return true;
+      }
+    else
+      {
+      return false;
+      }
     }
-  return this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset();
+  return
+    this->cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(toolset);
 }
 
 //----------------------------------------------------------------------------
@@ -180,3 +220,46 @@
   lg->SetGlobalGenerator(this);
   return lg;
 }
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio12Generator::IsWindowsDesktopToolsetInstalled() const
+{
+  const char desktop81Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "VisualStudio\\12.0\\VC\\LibraryDesktop";
+
+  std::vector<std::string> subkeys;
+  return cmSystemTools::GetRegistrySubKeys(desktop81Key,
+                                           subkeys,
+                                           cmSystemTools::KeyWOW64_32);
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio12Generator::IsWindowsPhoneToolsetInstalled() const
+{
+  const char wp81Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "Microsoft SDKs\\WindowsPhone\\v8.1\\Install Path;Install Path";
+
+  std::string path;
+  cmSystemTools::ReadRegistryValue(wp81Key,
+                                   path,
+                                   cmSystemTools::KeyWOW64_32);
+  return !path.empty();
+}
+
+//----------------------------------------------------------------------------
+bool
+cmGlobalVisualStudio12Generator::IsWindowsStoreToolsetInstalled() const
+{
+  const char win81Key[] =
+    "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+    "VisualStudio\\12.0\\VC\\Libraries\\Core\\Arm";
+
+  std::vector<std::string> subkeys;
+  return cmSystemTools::GetRegistrySubKeys(win81Key,
+                                           subkeys,
+                                           cmSystemTools::KeyWOW64_32);
+}
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index ec85f10..a81516f 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -41,8 +41,14 @@
 protected:
   virtual bool InitializeWindowsPhone(cmMakefile* mf);
   virtual bool InitializeWindowsStore(cmMakefile* mf);
-  virtual std::string SelectWindowsPhoneToolset() const;
-  virtual std::string SelectWindowsStoreToolset() const;
+  virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
+  virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
+
+  // These aren't virtual because we need to check if the selected version
+  // of the toolset is installed
+  bool IsWindowsDesktopToolsetInstalled() const;
+  bool IsWindowsPhoneToolsetInstalled() const;
+  bool IsWindowsStoreToolsetInstalled() const;
   virtual const char* GetIDEVersion() { return "12.0"; }
 private:
   class Factory;
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index d001f93..fe702c0 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -13,21 +13,36 @@
 #include "cmLocalVisualStudio10Generator.h"
 #include "cmMakefile.h"
 
-static const char vs14generatorName[] = "Visual Studio 14";
+static const char vs14generatorName[] = "Visual Studio 14 2015";
+
+// Map generator name without year to name with year.
+static const char* cmVS14GenName(const std::string& name, std::string& genName)
+{
+  if(strncmp(name.c_str(), vs14generatorName,
+             sizeof(vs14generatorName)-6) != 0)
+    {
+    return 0;
+    }
+  const char* p = name.c_str() + sizeof(vs14generatorName) - 6;
+  if(cmHasLiteralPrefix(p, " 2015"))
+    {
+    p += 5;
+    }
+  genName = std::string(vs14generatorName) + p;
+  return p;
+}
 
 class cmGlobalVisualStudio14Generator::Factory
   : public cmGlobalGeneratorFactory
 {
 public:
   virtual cmGlobalGenerator* CreateGlobalGenerator(
-    const std::string& genName) const
+                                                const std::string& name) const
     {
-    if(strncmp(genName.c_str(), vs14generatorName,
-               sizeof(vs14generatorName) - 1) != 0)
-      {
-      return 0;
-      }
-    const char* p = genName.c_str() + sizeof(vs14generatorName) - 1;
+    std::string genName;
+    const char* p = cmVS14GenName(name, genName);
+    if(!p)
+      { return 0; }
     if(!*p)
       {
       return new cmGlobalVisualStudio14Generator(
@@ -51,7 +66,7 @@
   virtual void GetDocumentation(cmDocumentationEntry& entry) const
     {
     entry.Name = vs14generatorName;
-    entry.Brief = "Generates Visual Studio 14 project files.";
+    entry.Brief = "Generates Visual Studio 14 (VS 2015) project files.";
     }
 
   virtual void GetGenerators(std::vector<std::string>& names) const
@@ -85,7 +100,12 @@
 cmGlobalVisualStudio14Generator::MatchesGeneratorName(
                                                 const std::string& name) const
 {
-  return name == this->GetName();
+  std::string genName;
+  if(cmVS14GenName(name, genName))
+    {
+    return genName == this->GetName();
+    }
+  return false;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0bd1624..b7e89b8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -102,7 +102,6 @@
   this->PreOrder = false;
   this->GeneratingBuildSystem = false;
 
-  this->NumLastMatches = 0;
   this->SuppressWatches = false;
 }
 
@@ -153,7 +152,6 @@
   this->ListFileStack = mf.ListFileStack;
   this->OutputToSource = mf.OutputToSource;
 
-  this->NumLastMatches = mf.NumLastMatches;
   this->SuppressWatches = mf.SuppressWatches;
 }
 
@@ -4743,51 +4741,6 @@
   return this->QtUiFilesWithOptions;
 }
 
-static std::string matchVariables[] = {
-  "CMAKE_MATCH_0",
-  "CMAKE_MATCH_1",
-  "CMAKE_MATCH_2",
-  "CMAKE_MATCH_3",
-  "CMAKE_MATCH_4",
-  "CMAKE_MATCH_5",
-  "CMAKE_MATCH_6",
-  "CMAKE_MATCH_7",
-  "CMAKE_MATCH_8",
-  "CMAKE_MATCH_9"
-};
-
-//----------------------------------------------------------------------------
-void cmMakefile::ClearMatches()
-{
-  for (unsigned int i=0; i<this->NumLastMatches; i++)
-    {
-    std::string const& var = matchVariables[i];
-    std::string const& s = this->GetSafeDefinition(var);
-    if(!s.empty())
-      {
-      this->AddDefinition(var, "");
-      this->MarkVariableAsUsed(var);
-      }
-    }
-  this->NumLastMatches = 0;
-}
-
-//----------------------------------------------------------------------------
-void cmMakefile::StoreMatches(cmsys::RegularExpression& re)
-{
-  for (unsigned int i=0; i<10; i++)
-    {
-    std::string const& m = re.match(i);
-    if(!m.empty())
-      {
-      std::string const& var = matchVariables[i];
-      this->AddDefinition(var, m.c_str());
-      this->MarkVariableAsUsed(var);
-      this->NumLastMatches = i + 1;
-      }
-    }
-}
-
 //----------------------------------------------------------------------------
 cmPolicies::PolicyStatus
 cmMakefile::GetPolicyStatus(cmPolicies::PolicyID id) const
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 164290a..28f8686 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -942,9 +942,6 @@
                        std::string const& lhs,
                        std::string const& rhs);
 
-  void ClearMatches();
-  void StoreMatches(cmsys::RegularExpression& re);
-
 protected:
   // add link libraries and directories to the target
   void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
@@ -1150,8 +1147,6 @@
 
   std::vector<cmSourceFile*> QtUiFilesWithOptions;
 
-  unsigned int NumLastMatches;
-
   bool AddRequiredTargetCFeature(cmTarget *target,
                                  const std::string& feature) const;
 
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1f8f686..85e371d 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1846,7 +1846,7 @@
                           useWatcomQuote);
   linkLibs = frameworkPath + linkPath + linkLibs;
 
-  if(useResponseFile)
+  if(useResponseFile && linkLibs.find_first_not_of(" ") != linkLibs.npos)
     {
     // Lookup the response file reference flag.
     std::string responseFlagVar = "CMAKE_";
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 1c2454e..004fd1f 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -216,7 +216,8 @@
     // Both extensions are similarly ambiguous.  Since only the old fixed set
     // of extensions will be tried, the names must match at this point to be
     // the same file.
-    if(this->Name.size() != loc.Name.size() || this->Name != loc.Name)
+    if(this->Name.size() != loc.Name.size() ||
+      !cmSystemTools::ComparePath(this->Name, loc.Name))
       {
       return false;
       }
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 90a8f85..93aa083 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -310,7 +310,7 @@
     input += args[i];
     }
 
-  this->Makefile->ClearMatches();
+  this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
   if(!re.compile(regex.c_str()))
@@ -325,7 +325,7 @@
   std::string output;
   if(re.find(input.c_str()))
     {
-    this->Makefile->StoreMatches(re);
+    this->StoreMatches(this->Makefile, re);
     std::string::size_type l = re.start();
     std::string::size_type r = re.end();
     if(r-l == 0)
@@ -359,7 +359,7 @@
     input += args[i];
     }
 
-  this->Makefile->ClearMatches();
+  this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
   if(!re.compile(regex.c_str()))
@@ -376,7 +376,7 @@
   const char* p = input.c_str();
   while(re.find(p))
     {
-    this->Makefile->StoreMatches(re);
+    this->StoreMatches(this->Makefile, re);
     std::string::size_type l = re.start();
     std::string::size_type r = re.end();
     if(r-l == 0)
@@ -463,7 +463,7 @@
     input += args[i];
     }
 
-  this->Makefile->ClearMatches();
+  this->ClearMatches(this->Makefile);
   // Compile the regular expression.
   cmsys::RegularExpression re;
   if(!re.compile(regex.c_str()))
@@ -480,7 +480,7 @@
   std::string::size_type base = 0;
   while(re.find(input.c_str()+base))
     {
-    this->Makefile->StoreMatches(re);
+    this->StoreMatches(this->Makefile, re);
     std::string::size_type l2 = re.start();
     std::string::size_type r = re.end();
 
@@ -541,6 +541,38 @@
 }
 
 //----------------------------------------------------------------------------
+void cmStringCommand::ClearMatches(cmMakefile* mf)
+{
+  for (unsigned int i=0; i<10; i++)
+    {
+    char name[128];
+    sprintf(name, "CMAKE_MATCH_%d", i);
+    const char* s = mf->GetDefinition(name);
+    if(s && *s != 0)
+      {
+      mf->AddDefinition(name, "");
+      mf->MarkVariableAsUsed(name);
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+void cmStringCommand::StoreMatches(cmMakefile* mf,cmsys::RegularExpression& re)
+{
+  for (unsigned int i=0; i<10; i++)
+    {
+    std::string m = re.match(i);
+    if(m.size() > 0)
+      {
+      char name[128];
+      sprintf(name, "CMAKE_MATCH_%d", i);
+      mf->AddDefinition(name, re.match(i).c_str());
+      mf->MarkVariableAsUsed(name);
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 bool cmStringCommand::HandleFindCommand(std::vector<std::string> const&
                                            args)
 {
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 9c75095..a5fe893 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -53,6 +53,8 @@
   virtual std::string GetName() const { return "string";}
 
   cmTypeMacro(cmStringCommand, cmCommand);
+  static void ClearMatches(cmMakefile* mf);
+  static void StoreMatches(cmMakefile* mf, cmsys::RegularExpression& re);
 protected:
   bool HandleConfigureCommand(std::vector<std::string> const& args);
   bool HandleAsciiCommand(std::vector<std::string> const& args);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b476a27..ad1c83e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -649,6 +649,8 @@
   for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator
       it = entries.begin(), end = entries.end(); it != end; ++it)
     {
+    cmLinkImplItem const& item = (*it)->LinkImplItem;
+    std::string const& targetName = item;
     std::vector<std::string> entrySources;
     cmSystemTools::ExpandListArgument((*it)->ge->Evaluate(mf,
                                               config,
@@ -667,11 +669,10 @@
         i != entrySources.end(); ++i)
       {
       std::string& src = *i;
-
       cmSourceFile* sf = mf->GetOrCreateSource(src);
       std::string e;
-      src = sf->GetFullPath(&e);
-      if(src.empty())
+      std::string fullPath = sf->GetFullPath(&e);
+      if(fullPath.empty())
         {
         if(!e.empty())
           {
@@ -681,6 +682,25 @@
           }
         return contextDependent;
         }
+
+      if (!targetName.empty() && !cmSystemTools::FileIsFullPath(src.c_str()))
+        {
+        cmOStringStream err;
+        if (!targetName.empty())
+          {
+          err << "Target \"" << targetName << "\" contains relative "
+            "path in its INTERFACE_SOURCES:\n"
+            "  \"" << src << "\"";
+          }
+        else
+          {
+          err << "Found relative path while evaluating sources of "
+          "\"" << tgt->GetName() << "\":\n  \"" << src << "\"\n";
+          }
+        tgt->GetMakefile()->IssueMessage(cmake::FATAL_ERROR, err.str());
+        return contextDependent;
+        }
+      src = fullPath;
       }
     std::string usedSources;
     for(std::vector<std::string>::iterator
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 26fc317..92ec421 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -326,9 +326,9 @@
     this->WriteString("<PropertyGroup Label=\"NsightTegraProject\">\n", 1);
     if(this->NsightTegraVersion[0] >= 2)
       {
-      // Nsight Tegra 2.0 uses project revision 8.
+      // Nsight Tegra 2.0 uses project revision 9.
       this->WriteString("<NsightTegraProjectRevisionNumber>"
-                        "8"
+                        "9"
                         "</NsightTegraProjectRevisionNumber>\n", 2);
       // Tell newer versions to upgrade silently when loading.
       this->WriteString("<NsightTegraUpgradeOnceWithoutPrompt>"
@@ -1203,6 +1203,8 @@
   bool toolHasSettings = false;
   std::string tool = "None";
   std::string shaderType;
+  std::string shaderEntryPoint;
+  std::string shaderModel;
   std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
   if(ext == "hlsl")
     {
@@ -1213,6 +1215,18 @@
       shaderType = st;
       toolHasSettings = true;
       }
+    // Figure out which entry point to use if any
+    if (const char* se = sf->GetProperty("VS_SHADER_ENTRYPOINT"))
+      {
+      shaderEntryPoint = se;
+      toolHasSettings = true;
+      }
+    // Figure out which entry point to use if any
+    if (const char* sm = sf->GetProperty("VS_SHADER_MODEL"))
+      {
+      shaderModel = sm;
+      toolHasSettings = true;
+      }
     }
   else if(ext == "jpg" ||
           ext == "png")
@@ -1247,6 +1261,7 @@
     }
 
   std::string deployContent;
+  std::string deployLocation;
   if(this->GlobalGenerator->TargetsWindowsPhone() ||
      this->GlobalGenerator->TargetsWindowsStore())
     {
@@ -1255,6 +1270,12 @@
       {
       toolHasSettings = true;
       deployContent = content;
+
+      const char* location = sf->GetProperty("VS_DEPLOYMENT_LOCATION");
+      if(location && *location)
+        {
+        deployLocation = location;
+        }
       }
     }
 
@@ -1269,6 +1290,14 @@
       cmGeneratorExpression ge;
       cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
         ge.Parse(deployContent);
+      // Deployment location cannot be set on a configuration basis
+      if(!deployLocation.empty())
+        {
+        this->WriteString("<Link>", 3);
+        (*this->BuildFileStream) << deployLocation
+                                 << "\\%(FileName)%(Extension)";
+        this->WriteString("</Link>\n", 0);
+        }
       for(size_t i = 0; i != configs->size(); ++i)
         {
         if(0 == strcmp(cge->Evaluate(this->Makefile, (*configs)[i]), "1"))
@@ -1295,7 +1324,18 @@
       (*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
                                << "</ShaderType>\n";
       }
-
+    if(!shaderEntryPoint.empty())
+      {
+      this->WriteString("<EntryPointName>", 3);
+      (*this->BuildFileStream) << cmVS10EscapeXML(shaderEntryPoint)
+                               << "</EntryPointName>\n";
+      }
+    if(!shaderModel.empty())
+      {
+      this->WriteString("<ShaderModel>", 3);
+      (*this->BuildFileStream) << cmVS10EscapeXML(shaderModel)
+                               << "</ShaderModel>\n";
+      }
     this->WriteString("</", 2);
     (*this->BuildFileStream) << tool << ">\n";
     }
@@ -2036,7 +2076,8 @@
 void
 cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
 {
-  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
+  if(this->Target->GetType() != cmTarget::STATIC_LIBRARY &&
+     this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
     {
     return;
     }
@@ -2267,7 +2308,14 @@
         linkOptions.AddFlag("SubSystem", "WindowsCE");
         if (this->Target->GetType() == cmTarget::EXECUTABLE)
           {
-          linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
+          if (this->ClOptions[config]->UsingUnicode())
+            {
+            linkOptions.AddFlag("EntryPointSymbol", "wWinMainCRTStartup");
+            }
+          else
+            {
+            linkOptions.AddFlag("EntryPointSymbol", "WinMainCRTStartup");
+            }
           }
         }
       else
@@ -2282,7 +2330,14 @@
         linkOptions.AddFlag("SubSystem", "WindowsCE");
         if (this->Target->GetType() == cmTarget::EXECUTABLE)
           {
-          linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
+          if (this->ClOptions[config]->UsingUnicode())
+            {
+            linkOptions.AddFlag("EntryPointSymbol", "mainWCRTStartup");
+            }
+          else
+            {
+            linkOptions.AddFlag("EntryPointSymbol", "mainACRTStartup");
+            }
           }
         }
       else
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 09d270d..36a0645 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1403,7 +1403,7 @@
         {"10.0", "Visual Studio 10 2010"},
         {"11.0", "Visual Studio 11 2012"},
         {"12.0", "Visual Studio 12 2013"},
-        {"14.0", "Visual Studio 14"},
+        {"14.0", "Visual Studio 14 2015"},
         {0, 0}};
       for(int i=0; version[i].MSVersion != 0; i++)
         {
diff --git a/Source/kwsys/SharedForward.h.in b/Source/kwsys/SharedForward.h.in
index 7ff29b4..c6f345f 100644
--- a/Source/kwsys/SharedForward.h.in
+++ b/Source/kwsys/SharedForward.h.in
@@ -813,7 +813,7 @@
 }
 
 /* Static storage space to store the updated environment variable.  */
-static char kwsys_shared_forward_ldpath[KWSYS_SHARED_FORWARD_MAXPATH*16] = KWSYS_SHARED_FORWARD_LDPATH "=";
+static char kwsys_shared_forward_ldpath[65535] = KWSYS_SHARED_FORWARD_LDPATH "=";
 
 /*--------------------------------------------------------------------------*/
 /* Main driver function to be called from main.  */
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 25cc846..a9cad14 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -292,11 +292,11 @@
   endif()
   ADD_TEST_MACRO(SourcesProperty SourcesProperty)
   if(CMAKE_CXX_COMPILER_ID STREQUAL GNU
-      AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
+      AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
     set(runCxxDialectTest 1)
   endif()
   if(CMAKE_CXX_COMPILER_ID STREQUAL Clang
-        AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9)
+        AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
     if(NOT APPLE OR POLICY CMP0025)
       set(runCxxDialectTest 1)
     endif()
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index d02ddaf..ff5d745 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -77,36 +77,60 @@
   endif()
 endforeach()
 
-add_executable(CompileFeatures main.cpp)
-set_property(TARGET CompileFeatures
-  PROPERTY COMPILE_FEATURES "cxx_auto_type"
-)
-set_property(TARGET CompileFeatures
-  PROPERTY CXX_STANDARD_REQUIRED TRUE
-)
+if (CMAKE_C_COMPILE_FEATURES)
+  string(FIND "${CMAKE_C_FLAGS}" "-std=" std_flag_idx)
+  if (std_flag_idx EQUAL -1)
+    add_executable(default_dialect_C default_dialect.c)
+    target_compile_definitions(default_dialect_C PRIVATE
+      DEFAULT_C11=$<EQUAL:${CMAKE_C_STANDARD_DEFAULT},11>
+      DEFAULT_C99=$<EQUAL:${CMAKE_C_STANDARD_DEFAULT},99>
+      DEFAULT_C90=$<EQUAL:${CMAKE_C_STANDARD_DEFAULT},90>
+    )
+  endif()
+endif()
 
-add_executable(GenexCompileFeatures main.cpp)
-set_property(TARGET GenexCompileFeatures
-  PROPERTY COMPILE_FEATURES "$<1:cxx_auto_type>;$<0:not_a_feature>"
-)
+if (CMAKE_CXX_COMPILE_FEATURES)
+  string(FIND "${CMAKE_CXX_FLAGS}" "-std=" std_flag_idx)
+  if (std_flag_idx EQUAL -1)
+    add_executable(default_dialect default_dialect.cpp)
+    target_compile_definitions(default_dialect PRIVATE
+      DEFAULT_CXX14=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},14>
+      DEFAULT_CXX11=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},11>
+      DEFAULT_CXX98=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},98>
+    )
+  endif()
 
-add_library(iface INTERFACE)
-set_property(TARGET iface
-  PROPERTY INTERFACE_COMPILE_FEATURES "cxx_auto_type"
-)
-add_executable(IfaceCompileFeatures main.cpp)
-target_link_libraries(IfaceCompileFeatures iface)
+  add_executable(CompileFeatures main.cpp)
+  set_property(TARGET CompileFeatures
+    PROPERTY COMPILE_FEATURES "cxx_auto_type"
+  )
+  set_property(TARGET CompileFeatures
+    PROPERTY CXX_STANDARD_REQUIRED TRUE
+  )
 
-add_executable(CompileFeaturesGenex genex_test.cpp)
-set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
-target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  add_executable(GenexCompileFeatures main.cpp)
+  set_property(TARGET GenexCompileFeatures
+    PROPERTY COMPILE_FEATURES "$<1:cxx_auto_type>;$<0:not_a_feature>"
+  )
 
-add_executable(CompileFeaturesGenex2 genex_test.cpp)
-target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr)
-target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  add_library(iface INTERFACE)
+  set_property(TARGET iface
+    PROPERTY INTERFACE_COMPILE_FEATURES "cxx_auto_type"
+  )
+  add_executable(IfaceCompileFeatures main.cpp)
+  target_link_libraries(IfaceCompileFeatures iface)
 
-add_library(noexcept_iface INTERFACE)
-target_compile_features(noexcept_iface INTERFACE cxx_noexcept)
-add_executable(CompileFeaturesGenex3 genex_test.cpp)
-target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface)
-target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+  add_executable(CompileFeaturesGenex genex_test.cpp)
+  set_property(TARGET CompileFeaturesGenex PROPERTY CXX_STANDARD 11)
+  target_compile_definitions(CompileFeaturesGenex PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+
+  add_executable(CompileFeaturesGenex2 genex_test.cpp)
+  target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_constexpr)
+  target_compile_definitions(CompileFeaturesGenex2 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+
+  add_library(noexcept_iface INTERFACE)
+  target_compile_features(noexcept_iface INTERFACE cxx_noexcept)
+  add_executable(CompileFeaturesGenex3 genex_test.cpp)
+  target_link_libraries(CompileFeaturesGenex3 PRIVATE noexcept_iface)
+  target_compile_definitions(CompileFeaturesGenex3 PRIVATE HAVE_OVERRIDE_CONTROL=$<COMPILE_FEATURES:cxx_final,cxx_override>)
+endif()
diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c
new file mode 100644
index 0000000..1b39dec
--- /dev/null
+++ b/Tests/CompileFeatures/default_dialect.c
@@ -0,0 +1,22 @@
+
+#if DEFAULT_C11
+#  if __STDC_VERSION__ != 201112L
+#    error Unexpected value for __STDC_VERSION__.
+#  endif
+#elif DEFAULT_C99
+#  if __STDC_VERSION__ != 199901L
+#    error Unexpected value for __STDC_VERSION__.
+#  endif
+#else
+#  if !DEFAULT_C90
+#    error Buildsystem error
+#  endif
+#  if defined(__STDC_VERSION__)
+#    error Unexpected __STDC_VERSION__ definition
+#  endif
+#endif
+
+int main()
+{
+  return 0;
+}
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
new file mode 100644
index 0000000..8d97926
--- /dev/null
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -0,0 +1,25 @@
+
+template<long l>
+struct Outputter;
+
+#if DEFAULT_CXX14
+#  if __cplusplus != 201402L
+Outputter<__cplusplus> o;
+#  endif
+#elif DEFAULT_CXX11
+#  if __cplusplus != 201103L
+Outputter<__cplusplus> o;
+#  endif
+#else
+#  if !DEFAULT_CXX98
+#    error Buildsystem error
+#  endif
+#  if __cplusplus != 199711L
+Outputter<__cplusplus> o;
+#  endif
+#endif
+
+int main()
+{
+  return 0;
+}
diff --git a/Tests/CompileFeatures/main.c b/Tests/CompileFeatures/main.c
deleted file mode 100644
index 831c5eb2..0000000
--- a/Tests/CompileFeatures/main.c
+++ /dev/null
@@ -1,12 +0,0 @@
-
-int foo(int * restrict a, int * restrict b)
-{
-  (void)a;
-  (void)b;
-  return 0;
-}
-
-int main()
-{
-  return 0;
-}
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index c272257..748aad8 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -5,9 +5,9 @@
 
 add_library(iface INTERFACE)
 set_property(TARGET iface PROPERTY INTERFACE_SOURCES
-  iface_src.cpp
-  $<$<CONFIG:Debug>:iface_debug_src.cpp>
-  $<$<CONFIG:Release>:does_not_exist.cpp>
+  "${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
+  "$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/iface_debug_src.cpp>"
+  "$<$<CONFIG:Release>:${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp>"
 )
 
 add_executable(ConfigSources
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index fe202dd..ee81419 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -22,8 +22,11 @@
 add_library(iface_objlib INTERFACE)
 target_sources(iface_objlib INTERFACE $<TARGET_OBJECTS:objlib>)
 
+add_library(intermediate INTERFACE)
+target_link_libraries(intermediate INTERFACE iface_objlib)
+
 add_executable(InterfaceLibrary definetestexe.cpp)
-target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface iface_objlib)
+target_link_libraries(InterfaceLibrary iface_nodepends headeriface subiface intermediate)
 
 add_subdirectory(libsdir)
 
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 645cc65..7bf9f28 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -63,6 +63,13 @@
   list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
 endif()
 
+if (CMAKE_C_COMPILER_ID STREQUAL GNU
+    OR CMAKE_C_COMPILER_ID STREQUAL Clang)
+  add_executable(C_undefined c_undefined.c)
+  set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90)
+  target_compile_options(C_undefined PRIVATE -Werror=undef)
+endif()
+
 add_executable(WriteCompilerDetectionHeader main.cpp)
 set_property(TARGET WriteCompilerDetectionHeader PROPERTY CXX_STANDARD 98)
 set_defines(WriteCompilerDetectionHeader "${true_defs}" "${false_defs}")
diff --git a/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
new file mode 100644
index 0000000..487e66d
--- /dev/null
+++ b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
@@ -0,0 +1,7 @@
+
+#include "test_compiler_detection.h"
+
+int main()
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-result.txt b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt b/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
new file mode 100644
index 0000000..0d65a55
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Target "iface" has a populated INTERFACE_SOURCES property.  This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportBuild.cmake b/Tests/RunCMake/TargetSources/ExportBuild.cmake
new file mode 100644
index 0000000..b626aa6
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportBuild.cmake
@@ -0,0 +1,5 @@
+
+add_library(iface INTERFACE)
+target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp")
+
+export(TARGETS iface FILE ${CMAKE_CURRENT_BINARY_DIR}/targets.cmake)
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-result.txt b/Tests/RunCMake/TargetSources/ExportInstall-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt b/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
new file mode 100644
index 0000000..0d65a55
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Target "iface" has a populated INTERFACE_SOURCES property.  This is not currently supported.
diff --git a/Tests/RunCMake/TargetSources/ExportInstall.cmake b/Tests/RunCMake/TargetSources/ExportInstall.cmake
new file mode 100644
index 0000000..8e7c9f9
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/ExportInstall.cmake
@@ -0,0 +1,6 @@
+
+add_library(iface INTERFACE)
+target_sources(iface INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp")
+
+install(TARGETS iface EXPORT exp)
+install(EXPORT exp DESTINATION cmake)
diff --git a/Tests/RunCMake/TargetSources/OriginDebug.cmake b/Tests/RunCMake/TargetSources/OriginDebug.cmake
index 5fe9ba7..d40a1d8 100644
--- a/Tests/RunCMake/TargetSources/OriginDebug.cmake
+++ b/Tests/RunCMake/TargetSources/OriginDebug.cmake
@@ -7,7 +7,7 @@
 
 add_library(iface INTERFACE)
 set_property(TARGET iface PROPERTY INTERFACE_SOURCES
-  empty_1.cpp
+  "${CMAKE_CURRENT_SOURCE_DIR}/empty_1.cpp"
 )
 
 add_library(OriginDebug empty_2.cpp)
diff --git a/Tests/RunCMake/TargetSources/RelativePathInInterface-result.txt b/Tests/RunCMake/TargetSources/RelativePathInInterface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/RelativePathInInterface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/RelativePathInInterface-stderr.txt b/Tests/RunCMake/TargetSources/RelativePathInInterface-stderr.txt
new file mode 100644
index 0000000..d47dd4d
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/RelativePathInInterface-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+  Target "iface" contains relative path in its INTERFACE_SOURCES:
+
+    "empty_1.cpp"
diff --git a/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake b/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake
new file mode 100644
index 0000000..8bb6149
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/RelativePathInInterface.cmake
@@ -0,0 +1,6 @@
+
+add_library(iface INTERFACE)
+target_sources(iface INTERFACE empty_1.cpp)
+
+add_executable(main main.cpp)
+target_link_libraries(main iface)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index 1d2eaec..1b4ef0b 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -8,3 +8,6 @@
 endif()
 
 run_cmake(CMP0026-LOCATION)
+run_cmake(RelativePathInInterface)
+run_cmake(ExportBuild)
+run_cmake(ExportInstall)
diff --git a/Tests/RunCMake/TargetSources/main.cpp b/Tests/RunCMake/TargetSources/main.cpp
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/main.cpp
@@ -0,0 +1,5 @@
+
+int main()
+{
+  return 0;
+}
diff --git a/Tests/SourcesProperty/CMakeLists.txt b/Tests/SourcesProperty/CMakeLists.txt
index 6c99e00..d1c35d8 100644
--- a/Tests/SourcesProperty/CMakeLists.txt
+++ b/Tests/SourcesProperty/CMakeLists.txt
@@ -4,7 +4,9 @@
 project(SourcesProperty)
 
 add_library(iface INTERFACE)
-set_property(TARGET iface PROPERTY INTERFACE_SOURCES iface.cpp)
+set_property(TARGET iface PROPERTY INTERFACE_SOURCES
+  "${CMAKE_CURRENT_SOURCE_DIR}/iface.cpp"
+)
 
 add_executable(SourcesProperty main.cpp)
 target_link_libraries(SourcesProperty iface)
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 0041c75..7227fcc 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -86,6 +86,9 @@
 elseif (NOT "${PLATFORM}" STREQUAL "DESKTOP")
   set(CONTENT_FILES ${CONTENT_FILES}
     ${CMAKE_CURRENT_BINARY_DIR}/${APP_MANIFEST_NAME}
+    )
+
+    set(ASSET_FILES ${ASSET_FILES}
     Direct3DApp1/Assets/Logo.png
     Direct3DApp1/Assets/SmallLogo.png
     Direct3DApp1/Assets/SplashScreen.png
@@ -94,16 +97,24 @@
 endif()
 
 set(RESOURCE_FILES
-  ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES}
+  ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} ${ASSET_FILES}
   Direct3DApp1/Direct3DApp1_TemporaryKey.pfx)
 
 set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
+set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1)
+set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets")
 set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>)
 set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY
   VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>)
 
 set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel)
+set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS)
+set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
+
 set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex)
+set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS)
+set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
+
 
 source_group("Source Files" FILES ${SOURCE_FILES})
 source_group("Header Files" FILES ${HEADER_FILES})
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
index d61e2c8..6796da1 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
+++ b/Tests/VSWinStorePhone/Direct3DApp1/SimplePixelShader.hlsl
@@ -4,7 +4,7 @@
   float3 color : COLOR0;
 };
 
-float4 main(PixelShaderInput input) : SV_TARGET
+float4 mainPS(PixelShaderInput input) : SV_TARGET
 {
   return float4(input.color,1.0f);
 }
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
index 65d60e5..0963060 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
+++ b/Tests/VSWinStorePhone/Direct3DApp1/SimpleVertexShader.hlsl
@@ -17,7 +17,7 @@
   float3 color : COLOR0;
 };
 
-VertexShaderOutput main(VertexShaderInput input)
+VertexShaderOutput mainVS(VertexShaderInput input)
 {
   VertexShaderOutput output;
   float4 pos = float4(input.pos, 1.0f);
diff --git a/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in
index d3cb21f..68172fa 100644
--- a/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in
+++ b/Tests/VSWinStorePhone/cmake/Package_vc11.store.appxmanifest.in
@@ -4,7 +4,7 @@
   <Properties>
     <DisplayName>@SHORT_NAME@</DisplayName>
     <PublisherDisplayName>mgong</PublisherDisplayName>
-    <Logo>StoreLogo.png</Logo>
+    <Logo>Assets/StoreLogo.png</Logo>
   </Properties>
   <Prerequisites>
     <OSMinVersion>6.2.1</OSMinVersion>
@@ -15,9 +15,9 @@
   </Resources>
   <Applications>
     <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="@SHORT_NAME@.App">
-      <VisualElements DisplayName="@SHORT_NAME@" Description="@SHORT_NAME@" BackgroundColor="#336699" ForegroundText="light" Logo="Logo.png" SmallLogo="SmallLogo.png">
+      <VisualElements DisplayName="@SHORT_NAME@" Description="@SHORT_NAME@" BackgroundColor="#336699" ForegroundText="light" Logo="Assets/Logo.png" SmallLogo="Assets/SmallLogo.png">
         <DefaultTile ShowName="allLogos" ShortName="@SHORT_NAME@" />
-        <SplashScreen Image="SplashScreen.png" />
+        <SplashScreen Image="Assets/SplashScreen.png" />
       </VisualElements>
     </Application>
   </Applications>
diff --git a/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in
index 495f18e..08205f5 100644
--- a/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in
+++ b/Tests/VSWinStorePhone/cmake/Package_vc12.store.appxmanifest.in
@@ -4,7 +4,7 @@
   <Properties>
     <DisplayName>@SHORT_NAME@</DisplayName>
     <PublisherDisplayName>mgong</PublisherDisplayName>
-    <Logo>StoreLogo.png</Logo>
+    <Logo>Assets/StoreLogo.png</Logo>
   </Properties>
   <Prerequisites>
     <OSMinVersion>6.3</OSMinVersion>
@@ -20,14 +20,14 @@
         Description="@SHORT_NAME@"
         BackgroundColor="#336699"
         ForegroundText="light"
-        Square150x150Logo="Logo.png"
-        Square30x30Logo="SmallLogo.png">
+        Square150x150Logo="Assets/Logo.png"
+        Square30x30Logo="Assets/SmallLogo.png">
         <m2:DefaultTile ShortName="@SHORT_NAME@">
           <m2:ShowNameOnTiles>
             <m2:ShowOn Tile="square150x150Logo" />
           </m2:ShowNameOnTiles>
         </m2:DefaultTile>
-        <m2:SplashScreen Image="SplashScreen.png" />
+        <m2:SplashScreen Image="Assets/SplashScreen.png" />
       </m2:VisualElements>
     </Application>
   </Applications>
diff --git a/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in b/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in
index 2d4d389..d47d43c 100644
--- a/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in
+++ b/Tests/VSWinStorePhone/cmake/Package_vc12.wp.appxmanifest.in
@@ -6,7 +6,7 @@
   <Properties>
     <DisplayName>@SHORT_NAME@</DisplayName>
     <PublisherDisplayName>mgong</PublisherDisplayName>
-    <Logo>StoreLogo.png</Logo>
+    <Logo>Assets/StoreLogo.png</Logo>
   </Properties>
   <Prerequisites>
     <OSMinVersion>6.3.1</OSMinVersion>
@@ -22,14 +22,14 @@
         Description="@SHORT_NAME@"
         BackgroundColor="#336699"
         ForegroundText="light"
-        Square150x150Logo="Logo.png"
-        Square30x30Logo="SmallLogo.png">
+        Square150x150Logo="Assets/Logo.png"
+        Square30x30Logo="Assets/SmallLogo.png">
         <m2:DefaultTile ShortName="@SHORT_NAME@">
           <m2:ShowNameOnTiles>
             <m2:ShowOn Tile="square150x150Logo" />
           </m2:ShowNameOnTiles>
         </m2:DefaultTile>
-        <m2:SplashScreen Image="SplashScreen.png" />
+        <m2:SplashScreen Image="Assets/SplashScreen.png" />
       </m2:VisualElements>
     </Application>
   </Applications>
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index ec39596..5c0406d 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -201,8 +201,13 @@
         if make_index_entry:
             title = self.parse_title(env.docname)
             # Insert the object link target.
-            targetid = '%s:%s' % (objtype, title)
+            if objtype == 'command':
+                targetname = title.lower()
+            else:
+                targetname = title
+            targetid = '%s:%s' % (objtype, targetname)
             targetnode = nodes.target('', '', ids=[targetid])
+            self.document.note_explicit_target(targetnode)
             self.document.insert(0, targetnode)
             # Insert the object index entry.
             indexnode = addnodes.index()
@@ -219,7 +224,11 @@
         return sig
 
     def add_target_and_index(self, name, sig, signode):
-        targetid = '%s:%s' % (self.objtype, name)
+        if self.objtype == 'command':
+           targetname = name.lower()
+        else:
+           targetname = name
+        targetid = '%s:%s' % (self.objtype, targetname)
         if targetid not in self.state.document.ids:
             signode['names'].append(targetid)
             signode['ids'].append(targetid)