[CMake] ALL_BUILD with msbuild

Dustyn Blasig dustyn at blasig.us
Mon May 13 14:35:46 EDT 2019


Ah, thanks, we do use EXCLUDE_FROM_ALL but I did not know about
EXCLUDE_FROM_DEFAULT_BUILD. From the documentation, it sounds like we
really do want to build the ALL_BUILD target, but I'm not sure how to get
the ZERO_CHECK project to properly build with msbuild. I can probably use
EXCLUDE_FROM_DEFAULT_BUILD as a workaround in the meantime, though.

On Mon, May 13, 2019 at 1:15 PM J. Caleb Wherry <calebwherry at gmail.com>
wrote:

> I do not specify the project name when running my main build, I call
> msbuild like you do in #2.
>
> How do you exclude things from ‘all’? I’ve actually ran into issues with
> VS and how pressing “Build” in the IDE and running on the command line do
> different things. This comes down to 2 target properties: EXCLUDE_FROM_ALL
> and EXCLUDE_FROM_DEFAULT_BUILD.
>
> These each do different things so I ended up setting them both to true for
> all my tests. Give that a shot and see what happens along with the #2 way
> of calling msbuild.
>
> -Caleb
>
> 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!
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>>
> --
> Sent from my iPhone SE
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190513/926527aa/attachment-0001.html>


More information about the CMake mailing list