[CMake] ALL_BUILD with msbuild

frodak17 frodak17 at gmail.com
Mon May 13 15:56:15 EDT 2019


On Mon, May 13, 2019 at 1:05 PM Dustyn Blasig <dustyn at blasig.us> wrote:

> Hi All,
>
> I'm trying to switch from devenv to msbuild on the command line so we can
> use the /m parallel build option. On devenv, I just build the ALL_BUILD
> target and it builds properly. However, on msbuild, there are two issues.
>
> 1. If I specify the ALL_BUILD target on the command line directly, I get
> the following errors. (... used to remove large paths)
>
> *c:\tmp\...>msbuild c:\tmp\...\mysolution.sln /t:ALL_BUILD /p:Configuration=Release /m || goto :ERROR
> *Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
> Copyright (C) Microsoft Corporation. All rights reserved.
>
> Build started 5/10/2019 1:01:52 PM.
>      1>Project "c:\tmp\...\mysolution.sln" on node 1 (ALL_BUILD target(s)).
>      1>ValidateSolutionConfiguration:
>          Building solution configuration "Release|x64".
>        ValidateProjects:
>          The project "ALL_BUILD" is not selected for building in solution configuration "Release|x64".
>          The project "Continuous" is not selected for building in solution configuration "Release|x64".
>          The project "Experimental" is not selected for building in solution configuration "Release|x64".
>          The project "Nightly" is not selected for building in solution configuration "Release|x64".
>          The project "NightlyMemoryCheck" is not selected for building in solution configuration "Release|x64".
>          The project "RUN_TESTS" is not selected for building in solution configuration "Release|x64".
>
>          ...
>      1>Project "c:\tmp\...\mysolution.sln" (1) is building "...\myproj.vcxproj.metaproj" (2) on node 1 (ALL_BUILD target(s)).*     2>Project "c:\tmp\...\myproj.vcxproj.metaproj" (2) is building "c:\tmp\...\ZERO_CHECK.vcxproj" (54) on node 2 (ALL_BUILD target(s)).
> *    54>c:\tmp\...\ZERO_CHECK.vcxproj : error MSB4057: The target "ALL_BUILD" does not exist in the project.
>     54>Done Building Project "c:\tmp\...\ZERO_CHECK.vcxproj" (ALL_BUILD target(s)) -- FAILED.
>      2>Done Building Project "c:\tmp\...\myproj.vcxproj.metaproj" (ALL_BUILD target(s)) -- FAILED.
>      1>Done Building Project "c:\tmp\...\mysolution.sln" (ALL_BUILD target(s)) -- FAILED.
>
> Build FAILED.
>
>        "c:\tmp\...\mysolution.sln" (ALL_BUILD target) (1) ->
>        "c:\tmp\...\myproj.vcxproj.metaproj" (ALL_BUILD target) (2) ->
>        "c:\tmp\...\ZERO_CHECK.vcxproj" (ALL_BUILD target) (54) ->
>          c:\tmp\...\ZERO_CHECK.vcxproj : error MSB4057: The target "ALL_BUILD" does not exist in the project.
>
>     0 Warning(s)
>     1 Error(s)
>
>
> What is different with the ALL_BUILD target between msbuild and devenv? I
> must be calling things improperly on the command line, but I'm not sure
> what.
>
> 2. If I instead leave ALL_BUILD off and just let it build the defaults, it
> gets further, but it also trys to build targets that are not enabled with
> the "all" target by default like our unit tests which we add through a
> hierarchy of targets like "run_tests_...".
>
> *c:\tmp\...>msbuild c:\tmp\...\mysolution.sln /p:Configuration=Release /m || goto :ERROR
> *
>
>
> Should calling msbuild on just the solution build only the "all" target by
> default, or does mbuild just build everything in the solution ignoring the
> "all" target stuff?
>
> Thanks!
> --
>

Personally I've just always used CMake to construct the command line by
using:
cmake --build . --config Release -j

Which constructs the command:
msbuild ALL_BUILD.vcxproj /p:Configuration=Release /m

I've been told that CMake targets do not translate to the targets usable by
the /target switch.

--
F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190513/e6d6a4f2/attachment.html>


More information about the CMake mailing list