首页 > 解决方案 > CMake 找不到 MSBuild.exe

问题描述

我正在尝试使用 cmake(用于 OpenGL 教程)构建 Assimp 库,但我无法使用 CMake 构建所需的文件。

CMakeOutput.txt 的结尾是:“系统是:Windows - 10.0.18362 - AMD64”

CMake GUI 给了我以下信息:

CMAKE_CONFIGURATION_TYPES:调试;发布;MinSizeRel;RelWithDebInfo

         CMake Error at CMakeLists.txt:38 (PROJECT):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Framework

    Copyright (C) Microsoft Corporation. All rights reserved.



    Build started 2/9/2020 12:30:21 PM.

    Project "E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj" on node 1 (default targets).

    PrepareForBuild:

      Creating directory "x64\Debug\".

      Creating directory "x64\Debug\VCTargetsPath.tlog\".

    InitializeBuildStatus:

      Creating "x64\Debug\VCTargetsPath.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

    PostBuildEvent:

      echo VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\

      :VCEnd

      'C:\Users\Sparkie' is not recognized as an internal or external command,

      operable program or batch file.

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: The command "echo VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\ [E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj]

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :VCEnd" exited with code 1. [E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj]

    Done Building Project "E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.



    Build FAILED.



    "E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj" (default target) (1) ->

    (PostBuildEvent target) -> 

      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: The command "echo VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\ [E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj]

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :VCEnd" exited with code 1. [E:\Softwares\assimp-4.1.0\build\CMakeFiles\3.16.4\VCTargetsPath.vcxproj]



        0 Warning(s)

        1 Error(s)



    Time Elapsed 00:00:00.22



  Exit code: 1



Configuring incomplete, errors occurred!
See also "E:/Softwares/assimp-4.1.0/build/CMakeFiles/CMakeOutput.log".

我已经尝试为这个问题寻找解决方案大约几周了,但似乎没有任何效果。任何帮助表示赞赏。

标签: c++cmakeassimp

解决方案


推荐阅读