[CMake] Cmake fails to build libssh2 - wants VC 2010 told for VC 2015 build

Barry Scott barry at barrys-emacs.org
Mon Mar 14 10:44:16 EDT 2016


Windows 10 with Cmake 3.4.3 or 3.5.0.
I have the following Visual C versions installed.

Microsoft Visual Studio 14.0
Microsoft Visual Studio 12.0
Microsoft Visual Studio 11.0
Visual C++ for Python

I use the following script to build libssh2:

setlocal
set VER=1.7.0
call "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\bin\amd64\vcvars64.bat"
set PATH="c:\Program Files (x86)\CMake\bin";%PATH%
if exist libssh2-%VER% rmdir /s /q libssh2-%VER%
c:\unxutils\zcat libssh2-%VER%.tar.gz | c:\unxutils\tar xf -
pushd libssh2-%VER%
mkdir build.Release
pushd build.Release
rem configure
cmake -G "Visual Studio 14 2015 Win64" ..
-DOPENSSL_ROOT_DIR=c:\OpenSource64 rem build
cmake --build . --config RelWithDebugInfo
popd
popd
endlocal


Cmake fails with:

Build FAILED.

"C:\Users\barry\Work\libssh2-1.7.0\build.Release\ALL_BUILD.vcxproj" (default
target) (1) ->
"C:\Users\barry\Work\libssh2-1.7.0\build.Release\ZERO_CHECK.vcxproj" (default
target) (2) -> (PlatformPrepareForBuild target) -> C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5):
error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset
= 'v100') cannot be found. To build using th e v100 build tools, please
install Visual Studio 2010 build tools.  Alternatively, you may upgrade
to the current Visual Studio tools by selecting the Project menu or
right-click the solution, and then selecting "Retarget solution".
[C:\Users\barry\Work\libssh2-1.7.0\build.Release\ZERO_CHECK.vcxproj]

    0 Warning(s)
    1 Error(s)

Why is CMAKE trying to use anything from VC 2010?

Can I work around this bug?
Removing VC 2010 is reasonable workaround.

Barry


More information about the CMake mailing list