title: Make CMake get Visual Studio build with x64 compiler and linker
body: <p>I would like to get CMake generate Visual Studio projects in a way that PreferredToolArchitecture is set to x64, so that when building in Visual Studio, x64 compiler and linker are used. The VS project file PropertyGroup for a configuration should have the PreferredToolArchitecture XML element according to this <a href="https://stackoverflow.com/questions/46683300/use-64-bit-compiler-in-visual-studio/46734431">answer</a>, e.g. as below</p>
  <pre class="lang-xml prettyprint-override"><code>  &lt;PropertyGroup Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot; Label=&quot;Configuration&quot;&gt;
      &lt;ConfigurationType&gt;DynamicLibrary&lt;/ConfigurationType&gt;
      &lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt;
      &lt;PlatformToolset&gt;v140&lt;/PlatformToolset&gt;
      &lt;PreferredToolArchitecture&gt;x64&lt;/PreferredToolArchitecture&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  <p>CMake <a href="https://cmake.org/cmake/help/v3.20/variable/CMAKE_GENERATOR_TOOLSET.html#variable:CMAKE_GENERATOR_TOOLSET" rel="nofollow noreferrer">doc</a> indicate that passing <code>-Tv140,host=x64</code> to the cmake command line should choose the x64 compiler.</p>
  <p>However I do not see the PreferredToolArchitecture XML element in the generated project files.</p>