[CMake] Custom targets & dependencies causing unintended builds

Petr Kmoch petr.kmoch at gmail.com
Mon Jun 10 02:43:59 EDT 2013


Hi Robert.

Whether a target is included in Visual Studio's "Build solution" is
controlled by target property EXCLUDE_FROM_DEFAULT_BUILD. Would setting it
for your custom target(s) help?

Petr


On Sat, Jun 8, 2013 at 11:57 PM, Robert Dailey <rcdailey.lists at gmail.com>wrote:

> I have two custom targets named A and B. These are not POST_BUILD
> targets, these are targets set to depend on files generated by custom
> commands. Neither custom target has the "ALL" option specified.
>
> I have called add_dependencies( A B ) to make A depend on B.
>
> When I Build Solution in Visual Studio, A does not build but B does
> build. I think because B is a dependency of A, even though A itself
> does not build, the dependency forces B to build. If I remove the
> add_dependencies() call, then neither A or B builds (desired
> behavior).
>
> If I run a build on ALL_BUILD, then regardless of dependencies set,
> neither A or B build (desired behavior).
>
> This seems like a defect to me. When I go to Configuration Manager
> (Right click solution -> Configuration Manager), I see that B is has
> the check box under "Build" checked. This is supposed to be unchecked.
> Basically when I make B a dependency of A, and B is a custom target,
> it should exclude B from the build unless 1) A has a dependency or 2)
> B has been created with the ALL option.
>
> Comments?
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130610/878b3313/attachment.htm>


More information about the CMake mailing list