Io uso msbuild a riga di comando per creare un file di soluzione generato:Forza MSBuild per costruire un progetto che è selezionata in soluzione config
msbuild /p:Configuration=Release /p:Platform=Win32 build\zlib\vc-9.0\x86\zlib.sln
Il problema è che la soluzione generata da CMake ha un progetto INSTALLARE che è non costruito per impostazione predefinita.
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)
Come posso forzare la destinazione dell'installazione da costruire senza aprire manualmente il soultion e impostare la casella di controllo per la configurazione?
Una soluzione è quella di chiamare il file vcproj direttamente (come ho fatto qui)
msbuild /p:Configuration=Release /p:Platform=Win32 build\zlib\vc-9.0\x86\INSTALL.vcproj
ma questo stampa il warning
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.
Come si può vedere, la build è riuscita. Sono in grado di garantire la build corretta chiamando prima la soluzione, ma voglio che lo forzi la soluzione per creare anche il progetto INSTALL.
Qualche idea?
Sono quasi sicuro che sia impossibile. E la soluzione che hai già trovato sembra abbastanza buona no?In alternativa non puoi usare qualcosa come "cmake --build --target install"? È passato un po 'di tempo da quando ho usato cmake ma mi sembra di ricordare che puoi invocare msbuild etc per te invece di farlo manualmente. – stijn
grazie mille, postalo come risposta e accetterò questa come soluzione valida. – Beachwalker