[cmake-developers] Specifying a VS installation path explicitly

Brad King brad.king at kitware.com
Thu Oct 29 11:20:56 EDT 2015


On 10/27/2015 11:03 AM, Brad King wrote:
> Please create a build tree under the environment in question and send me
> (off list) a .zip file of what CMake puts in the build tree.  Just use
> a simple CMakeLists.txt file like
> 
>  cmake_minimum_required(VERSION 3.3)
>  project(TestVS C)

Thanks for sending the file.  One can see in CMakeFiles/CMakeError.log
that the MS tools fail to build CMake's trivial compiler id test project:

> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(153,5): error MSB4018: The "CL" task failed unexpectedly.
> [E:\jenkins\jenkins_slave_bundles\workspace\BASE_BUNDLE_WIN\Libs\BASE\build\cmakeOutput\Win32\CMakeFiles\3.3.0-rc2\CompilerIdC\CompilerIdC.vcxproj]
> C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(153,5): error MSB4018: System.TypeInitializationException:
> The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.ArgumentException: The path is not of a legal form.
> [E:\jenkins\jenkins_slave_bundles\workspace\BASE_BUNDLE_WIN\Libs\BASE\build\cmakeOutput\Win32\CMakeFiles\3.3.0-rc2\CompilerIdC\CompilerIdC.vcxproj]

You can open that CompilerIdC.vcxproj file in an editor to see how
simple/minimal it is.  Try building that directly with msbuild under
your test environment.  You'll have to figure out how to get that
working independent of CMake first.  I suggest using a binary search
on available environment variables between an empty environment and
the standard one that works normally.

-Brad



More information about the cmake-developers mailing list