[Cmake-commits] CMake branch, next, updated. v3.3.2-3451-gacadaba

Brad King brad.king at kitware.com
Fri Oct 2 09:44:34 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  acadaba878e375554b6350b4257ee03ded5a03c9 (commit)
       via  d04e743b64e084c090b630c5bfc8c1c14ec96f1b (commit)
       via  5dfc4c5f50f3198186320320cfed699872e5ece0 (commit)
       via  61c472a287305490bef2047784d7670d8354cbf3 (commit)
       via  b31ac171a4acdc8d8eb1d08c5b5f61ec90a9dbaa (commit)
       via  70688609412421c3efa168f9c210a9e4e06a5578 (commit)
      from  6d8ad4e922aa85e22e5681c5ec999bffd9626b8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acadaba878e375554b6350b4257ee03ded5a03c9
commit acadaba878e375554b6350b4257ee03ded5a03c9
Merge: 6d8ad4e d04e743
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 2 09:44:33 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 2 09:44:33 2015 -0400

    Merge topic 'vs-win10-sdk' into next
    
    d04e743b VS: Add support for selecting the Windows 10 SDK
    5dfc4c5f VS: Add hook to initialize Windows platform settings
    61c472a2 cmSystemTools: Add VersionCompareGreater helper
    b31ac171 Allow CMAKE_SYSTEM_VERSION to be set without CMAKE_SYSTEM_NAME
    70688609 Help: Improve CMAKE_SYSTEM_{NAME,VERSION} variable documentation


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d04e743b64e084c090b630c5bfc8c1c14ec96f1b
commit d04e743b64e084c090b630c5bfc8c1c14ec96f1b
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Wed Sep 30 13:22:43 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 2 09:43:24 2015 -0400

    VS: Add support for selecting the Windows 10 SDK
    
    Teach the VS 2015 generator to produce a WindowsTargetPlatformVersion
    value.  Use the CMAKE_SYSTEM_VERSION to specify the version and if not
    set choose a default based on available SDKs.  Activate this behavior
    when targeting Windows 10.
    
    Co-Author: Brad King <brad.king at kitware.com>

diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 635db00..2116900 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -82,6 +82,7 @@ Variables that Provide Information
    /variable/CMAKE_VS_NsightTegra_VERSION
    /variable/CMAKE_VS_PLATFORM_NAME
    /variable/CMAKE_VS_PLATFORM_TOOLSET
+   /variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
    /variable/CMAKE_XCODE_PLATFORM_TOOLSET
    /variable/PROJECT_BINARY_DIR
    /variable/PROJECT-NAME_BINARY_DIR
diff --git a/Help/release/dev/vs-win10-sdk.rst b/Help/release/dev/vs-win10-sdk.rst
new file mode 100644
index 0000000..50eb391
--- /dev/null
+++ b/Help/release/dev/vs-win10-sdk.rst
@@ -0,0 +1,6 @@
+vs-win10-sdk
+------------
+
+* The :generator:`Visual Studio 14 2015` generator learned to select
+  a Windows 10 SDK based on the value of the :variable:`CMAKE_SYSTEM_VERSION`
+  variable and the SDKs available on the host.
diff --git a/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
new file mode 100644
index 0000000..6392849
--- /dev/null
+++ b/Help/variable/CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION.rst
@@ -0,0 +1,11 @@
+CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
+----------------------------------------
+
+Visual Studio Windows Target Platform Version.
+
+When targeting Windows 10 and above Visual Studio 2015 and above support
+specification of a target Windows version to select a corresponding SDK.
+The :variable:`CMAKE_SYSTEM_VERSION` variable may be set to specify a
+version.  Otherwise CMake computes a default version based on the Windows
+SDK versions available.  The chosen Windows target version number is provided
+in ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION``.
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index df6daf3..81c2509 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -209,6 +209,9 @@ Id flags: ${testflags}
     else()
       set(id_system_version "")
     endif()
+    if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION)
+      set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>")
+    endif()
     if(id_platform STREQUAL ARM)
       set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>")
     else()
diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in
index a17d03d..2870a11 100644
--- a/Modules/CompilerId/VS-10.vcxproj.in
+++ b/Modules/CompilerId/VS-10.vcxproj.in
@@ -12,6 +12,7 @@
     <Keyword>Win32Proj</Keyword>
     @id_system@
     @id_system_version@
+    @id_WindowsTargetPlatformVersion@
     @id_WindowsSDKDesktopARMSupport@
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 49c5616..f4861dc 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -74,6 +74,10 @@ public:
   /** Return the CMAKE_SYSTEM_VERSION.  */
   std::string const& GetSystemVersion() const { return this->SystemVersion; }
 
+  /** Return the Windows version targeted on VS 2015 and above.  */
+  std::string const& GetWindowsTargetPlatformVersion() const
+    { return this->WindowsTargetPlatformVersion; }
+
   /** Return true if building for WindowsCE */
   bool TargetsWindowsCE() const
     { return this->SystemIsWindowsCE; }
@@ -120,6 +124,7 @@ protected:
 
   std::string GeneratorToolset;
   std::string DefaultPlatformToolset;
+  std::string WindowsTargetPlatformVersion;
   std::string SystemName;
   std::string SystemVersion;
   std::string NsightTegraVersion;
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index d73eedf..74679d8 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -111,6 +111,34 @@ cmGlobalVisualStudio14Generator::MatchesGeneratorName(
 }
 
 //----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::InitializeWindows(cmMakefile* mf)
+{
+  if (cmHasLiteralPrefix(this->SystemVersion, "10.0"))
+    {
+    return this->SelectWindows10SDK(mf);
+    }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf)
+{
+  // Find the default version of the Windows 10 SDK.
+  this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
+  if (this->WindowsTargetPlatformVersion.empty())
+    {
+    std::ostringstream  e;
+    e << "Could not find an appropriate version of the Windows 10 SDK"
+      << " installed on this machine";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return false;
+    }
+  mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
+                    this->WindowsTargetPlatformVersion.c_str());
+  return true;
+}
+
+//----------------------------------------------------------------------------
 void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
 {
   // Visual Studio 14 writes .sln format 12.00
@@ -137,3 +165,55 @@ cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
   return cmSystemTools::GetRegistrySubKeys(desktop10Key,
     vc14, cmSystemTools::KeyWOW64_32);
 }
+
+//----------------------------------------------------------------------------
+std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+  // This logic is taken from the vcvarsqueryregistry.bat file from VS2015
+  // Try HKLM and then HKCU.
+  std::string win10Root;
+  if (!cmSystemTools::ReadRegistryValue(
+        "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+        "Windows Kits\\Installed Roots;KitsRoot10", win10Root,
+        cmSystemTools::KeyWOW64_32) &&
+      !cmSystemTools::ReadRegistryValue(
+        "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
+        "Windows Kits\\Installed Roots;KitsRoot10", win10Root,
+        cmSystemTools::KeyWOW64_32))
+    {
+    return std::string();
+    }
+
+  std::vector<std::string> sdks;
+  std::string path = win10Root + "Include/*";
+  // Grab the paths of the different SDKs that are installed
+  cmSystemTools::GlobDirs(path, sdks);
+  if (!sdks.empty())
+    {
+    // Only use the filename, which will be the SDK version.
+    for (std::vector<std::string>::iterator i = sdks.begin();
+         i != sdks.end(); ++i)
+      {
+      *i = cmSystemTools::GetFilenameName(*i);
+      }
+
+    // Sort the results to make sure we select the most recent one that
+    // has a version less or equal to our version of the operating system
+    std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
+
+    for (std::vector<std::string>::iterator i = sdks.begin();
+         i != sdks.end(); ++i)
+      {
+      // Find the SDK less or equal to our specified version
+      if (!cmSystemTools::VersionCompareGreater(*i, this->SystemVersion))
+        {
+        // This is the most recent SDK that we can run safely
+        return *i;
+        }
+      }
+    }
+#endif
+  // Return an empty string
+  return std::string();
+}
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index 02c6274..fcade85 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -30,12 +30,16 @@ public:
 
   virtual const char* GetToolsVersion() { return "14.0"; }
 protected:
+  virtual bool InitializeWindows(cmMakefile* mf);
   virtual const char* GetIDEVersion() { return "14.0"; }
+  virtual bool SelectWindows10SDK(cmMakefile* mf);
 
   // Used to verify that the Desktop toolset for the current generator is
   // installed on the machine.
   virtual bool IsWindowsDesktopToolsetInstalled() const;
 
+  std::string GetWindows10SDKVersion();
+
 private:
   class Factory;
 };
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 6c71313..91f2476 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3006,6 +3006,8 @@ IsXamlSource(const std::string& sourceFile)
 
 void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
 {
+  cmGlobalVisualStudio10Generator* gg =
+    static_cast<cmGlobalVisualStudio10Generator*>(this->GlobalGenerator);
   bool isAppContainer = false;
   bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone();
   bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore();
@@ -3062,6 +3064,14 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings()
     this->WriteString("<WindowsSDKDesktopARMSupport>true"
                       "</WindowsSDKDesktopARMSupport>\n", 2);
     }
+  std::string const& targetPlatformVersion =
+    gg->GetWindowsTargetPlatformVersion();
+  if (!targetPlatformVersion.empty())
+    {
+    this->WriteString("<WindowsTargetPlatformVersion>", 2);
+    (*this->BuildFileStream) << cmVS10EscapeXML(targetPlatformVersion) <<
+      "</WindowsTargetPlatformVersion>\n";
+    }
 }
 
 void cmVisualStudio10TargetGenerator::VerifyNecessaryFiles()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5dfc4c5f50f3198186320320cfed699872e5ece0
commit 5dfc4c5f50f3198186320320cfed699872e5ece0
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Wed Sep 23 14:27:07 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 2 09:43:24 2015 -0400

    VS: Add hook to initialize Windows platform settings
    
    Give VS 10+ generators a chance to choose Windows platform settings just
    as they already can for WindowsCE, WindowsStore, and WindowsPhone.

diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 44d632d..59e8f8c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -176,7 +176,14 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
 //----------------------------------------------------------------------------
 bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
 {
-  if (this->SystemName == "WindowsCE")
+  if (this->SystemName == "Windows")
+    {
+    if (!this->InitializeWindows(mf))
+      {
+      return false;
+      }
+    }
+  else if (this->SystemName == "WindowsCE")
     {
     this->SystemIsWindowsCE = true;
     if (!this->InitializeWindowsCE(mf))
@@ -184,7 +191,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
       return false;
       }
     }
-  else if(this->SystemName == "WindowsPhone")
+  else if (this->SystemName == "WindowsPhone")
     {
     this->SystemIsWindowsPhone = true;
     if(!this->InitializeWindowsPhone(mf))
@@ -192,7 +199,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
       return false;
       }
     }
-  else if(this->SystemName == "WindowsStore")
+  else if (this->SystemName == "WindowsStore")
     {
     this->SystemIsWindowsStore = true;
     if(!this->InitializeWindowsStore(mf))
@@ -229,6 +236,12 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
 }
 
 //----------------------------------------------------------------------------
+bool cmGlobalVisualStudio10Generator::InitializeWindows(cmMakefile*)
+{
+  return true;
+}
+
+//----------------------------------------------------------------------------
 bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
 {
   if (this->DefaultPlatformName != "Win32")
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 8de7b09..49c5616 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -105,6 +105,7 @@ public:
 protected:
   virtual void Generate();
   virtual bool InitializeSystem(cmMakefile* mf);
+  virtual bool InitializeWindows(cmMakefile* mf);
   virtual bool InitializeWindowsCE(cmMakefile* mf);
   virtual bool InitializeWindowsPhone(cmMakefile* mf);
   virtual bool InitializeWindowsStore(cmMakefile* mf);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=61c472a287305490bef2047784d7670d8354cbf3
commit 61c472a287305490bef2047784d7670d8354cbf3
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Wed Sep 30 13:22:43 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 2 09:43:24 2015 -0400

    cmSystemTools: Add VersionCompareGreater helper
    
    Wrap a call to VersionCompare with OP_GREATER in a signature suitable
    for use with std::sort.

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d3c1f16..2c5aa8a 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2777,6 +2777,14 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
 }
 
 //----------------------------------------------------------------------------
+bool cmSystemTools::VersionCompareGreater(std::string const& lhs,
+                                          std::string const& rhs)
+{
+  return cmSystemTools::VersionCompare(
+    cmSystemTools::OP_GREATER, lhs.c_str(), rhs.c_str());
+}
+
+//----------------------------------------------------------------------------
 bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
                                 bool* removed)
 {
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index e88170a..b6b0978 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -294,6 +294,8 @@ public:
    * Compare versions
    */
   static bool VersionCompare(CompareOp op, const char* lhs, const char* rhs);
+  static bool VersionCompareGreater(std::string const& lhs,
+                                    std::string const& rhs);
 
   /**
    * Determine the file type based on the extension

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b31ac171a4acdc8d8eb1d08c5b5f61ec90a9dbaa
commit b31ac171a4acdc8d8eb1d08c5b5f61ec90a9dbaa
Author:     Gilles Khouzam <gillesk at microsoft.com>
AuthorDate: Wed Sep 23 14:27:07 2015 -0700
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 2 09:43:24 2015 -0400

    Allow CMAKE_SYSTEM_VERSION to be set without CMAKE_SYSTEM_NAME
    
    Teach CMakeDetermineSystem to check for a CMAKE_SYSTEM_VERSION setting
    even when CMAKE_SYSTEM_NAME is not set.  This will allow builds on the
    host OS to target other versions of the OS without full cross-compiling.

diff --git a/Help/variable/CMAKE_SYSTEM_VERSION.rst b/Help/variable/CMAKE_SYSTEM_VERSION.rst
index f388ccf..aba8ca3 100644
--- a/Help/variable/CMAKE_SYSTEM_VERSION.rst
+++ b/Help/variable/CMAKE_SYSTEM_VERSION.rst
@@ -12,6 +12,13 @@ then ``CMAKE_SYSTEM_VERSION`` is by default set to the same value as the
 :variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets
 the host system version.
 
+In the case of a host build then ``CMAKE_SYSTEM_VERSION`` may be set
+explicitly when first configuring a new build tree in order to enable
+targeting the build for a different version of the host operating system
+than is actually running on the host.  This is allowed and not considered
+cross compiling so long as the binaries built for the specified OS version
+can still run on the host.
+
 System Version for Cross Compiling
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index fa14641..d9f7579 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -123,7 +123,9 @@ elseif(CMAKE_VS_WINCE_VERSION)
   set(PRESET_CMAKE_SYSTEM_NAME TRUE)
 else()
   set(CMAKE_SYSTEM_NAME      "${CMAKE_HOST_SYSTEM_NAME}")
-  set(CMAKE_SYSTEM_VERSION   "${CMAKE_HOST_SYSTEM_VERSION}")
+  if(NOT DEFINED CMAKE_SYSTEM_VERSION)
+    set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
+  endif()
   set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
   set(CMAKE_CROSSCOMPILING FALSE)
   set(PRESET_CMAKE_SYSTEM_NAME FALSE)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=70688609412421c3efa168f9c210a9e4e06a5578
commit 70688609412421c3efa168f9c210a9e4e06a5578
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 2 09:36:52 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 2 09:42:28 2015 -0400

    Help: Improve CMAKE_SYSTEM_{NAME,VERSION} variable documentation
    
    Specify their meaning for host builds and when cross compiling.
    Sepcify their relationship in each case.

diff --git a/Help/variable/CMAKE_SYSTEM_NAME.rst b/Help/variable/CMAKE_SYSTEM_NAME.rst
index 0466da4..c3a42e5 100644
--- a/Help/variable/CMAKE_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_SYSTEM_NAME.rst
@@ -1,8 +1,20 @@
 CMAKE_SYSTEM_NAME
 -----------------
 
-Name of the operating system CMake is building for.
+The name of the operating system for which CMake is to build.
+See the :variable:`CMAKE_SYSTEM_VERSION` variable for the OS version.
 
-This is the name of the operating system on which CMake is targeting.  This
-variable is the same as :variable:`CMAKE_HOST_SYSTEM_NAME` if you build for the
-host system instead of the target system when cross compiling.
+System Name for Host Builds
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``CMAKE_SYSTEM_NAME`` is by default set to the same value as the
+:variable:`CMAKE_HOST_SYSTEM_NAME` variable so that the build
+targets the host system.
+
+System Name for Cross Compiling
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``CMAKE_SYSTEM_NAME`` may be set explicitly when first configuring a new build
+tree in order to enable :ref:`cross compiling <Cross Compiling Toolchain>`.
+In this case the :variable:`CMAKE_SYSTEM_VERSION` variable must also be
+set explicitly.
diff --git a/Help/variable/CMAKE_SYSTEM_VERSION.rst b/Help/variable/CMAKE_SYSTEM_VERSION.rst
index 3b3cdc5..f388ccf 100644
--- a/Help/variable/CMAKE_SYSTEM_VERSION.rst
+++ b/Help/variable/CMAKE_SYSTEM_VERSION.rst
@@ -1,8 +1,21 @@
 CMAKE_SYSTEM_VERSION
 --------------------
 
-The operating system version CMake is building for.
+The version of the operating system for which CMake is to build.
+See the :variable:`CMAKE_SYSTEM_NAME` variable for the OS name.
 
-This variable is the same as :variable:`CMAKE_HOST_SYSTEM_VERSION` if
-you build for the host system instead of the target system when
-cross compiling.
+System Version for Host Builds
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When the :variable:`CMAKE_SYSTEM_NAME` variable takes its default value
+then ``CMAKE_SYSTEM_VERSION`` is by default set to the same value as the
+:variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets
+the host system version.
+
+System Version for Cross Compiling
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When the :variable:`CMAKE_SYSTEM_NAME` variable is set explicitly to
+enable :ref:`cross compiling <Cross Compiling Toolchain>` then the
+value of ``CMAKE_SYSTEM_VERSION`` must also be set explicitly to specify
+the target system version.

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list