【发布时间】:2017-09-05 09:35:56
【问题描述】:
我有一个生成 VS2015 解决方案文件 MyApp.sln 的 CMake 文件。我为每个配置分别使用以下命令构建 MyApp.sln:
msbuild MyApp.sln /property:Configuration=Debug
msbuild MyApp.sln /property:Configuration=RelWithDebInfo
msbuild MyApp.sln /property:Configuration=Release
我想知道是否有人知道如何使用单个 msbuild 命令构建所有配置。例如,CMake 可能会生成一些“全部”配置?
我的问题与How can I build all with MSBuild from the command line? 有点不同,因为我没有手动修改 MyApp.sln 文件,但它是由 CMake 生成的,所以我需要 CMake 中的一些选项来创建“全部”目标或调用 msbuild一种构建所有配置的方式。
【问题讨论】:
-
可能我的问题有点不同,因为我使用的是 CMake
-
CMake 用于生成解决方案,但您使用 msbuild 构建它。
-
您是否已经尝试过
msbuild MyApp.sln /t:ALL_BUILD /Configuration:"Debug;Release;RelWithDebInfo"? -
使用命令 msbuild LinesGameQt.sln /t:ALL_BUILD /p:Configuration="Debug;Release;RelWithDebInfo" 我得到 'error MSB4126: The specified solution configuration "Debug;Release;RelW ithDebInfo|Win32 “ 是无效的。请使用配置和平台属性指定有效的解决方案配置(例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")'