首页 > 解决方案 > MSBuild.exe 的 cmake 问题

问题描述

我在 Windows 10 上遇到了 cmake 的问题。我将事情修剪到会产生相同错误的最小示例。我从 Windows 命令提示符运行 cmake(Visual Studio 命令提示符的 git bash 命令行解释器也会出现同样的问题)。我的 CMakeLists.txt 包含三行:

cmake_minimum_required(VERSION 3.1)

project(DEBUG bogus)

我以这种方式运行 cmake:

cmake -G "Visual Studio 15 2017 Win64" .

一个 MSBuild.exe 窗口会短暂弹出一条错误消息,但我无法阅读它。它走得太快了。

命令行窗口显示此错误消息:

CMake Error at CMakeLists.txt:3 (project):

  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

-- Configuring incomplete, errors occurred!

See also "C:/Users/tmpuser/Desktop/SDK/dependencies/DEBUG/CMakeFiles/CMakeOutput.log".

MSBuild.exe 的可执行文件确实存在。CmakeOutput.log 文件包含:

The system is: Windows - 10.0.17763 - AMD64

有谁知道出了什么问题?

标签: cmakemsbuild

解决方案


推荐阅读