我在命令行中使用msbuild来构建生成的解决方案文件:
msbuild /p:Configuration=Release /p:Platform=Win32 build\zlib\vc-9.0\x86\zlib.sln
问题在于CMake生成的解决方案中,默认情况下没有构建一个名为“INSTALL”的项目。
minigzip:
Die Datei "c:\Library\build\zlib\vc-9.0\x86\minigzip.tmp_Release_Win32.vcproj
" wird gelöscht.
ALL_BUILD:
Die Datei "c:\Library\build\zlib\vc-9.0\x86\ALL_BUILD.tmp_Release_Win32.vcpro
j" wird gelöscht.
INSTALL:
The project "INSTALL" is not selected for building in solution configuration
"Release|Win32".
Done Building Project "c:\Library\build\zlib\vc-9.0\x86\zlib.sln" (default targ
ets).
Build succeeded.
0 Warning(s)
0 Error(s)
如何在不手动打开解决方案并为配置设置复选框的情况下强制构建目标 INSTALL?
一个解决方案是直接调用 vcproj 文件(就像我在这里做的那样)。
msbuild /p:Configuration=Release /p:Platform=Win32 build\zlib\vc-9.0\x86\INSTALL.vcproj
但是这会输出警告信息。
Microsoft (R)-Buildmodul, Version 3.5.30729.6387
[Microsoft .NET Framework, Version 2.0.50727.6400]
Copyright (C) Microsoft Corporation 2007. Alle Rechte vorbehalten.
Build started 06.07.2013 17:07:57.
Project "c:\Library\build\zlib\vc-9.0\x86\INSTALL.vcproj" on node 0 (default ta
rgets).
c:\Library\build\zlib\vc-9.0\x86\INSTALL.vcproj : warning MSB4098: MSBuild is i
nvoking VCBuild to build this project. Project-to-project references between VC
++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are n
ot supported by the command-line build systems when building stand-alone VC++ p
rojects. Projects that contain such project-to-project references will fail to
build. Please build the solution file containing this project instead.
Done Building Project "c:\Library\build\zlib\vc-9.0\x86\INSTALL.vcproj" (defaul
t targets).
Build succeeded.
正如您所见,构建成功了。通过先调用解决方案,我可以确保正确的构建,但我想强制解决方案也构建项目 INSTALL。
有什么好的想法吗?