Overly pessimistic warning on a target with EXCLUDE_FROM_ALL set and install rule defined
With the changes in CMake 3.14.0-rc2, presumably from !2816 (merged), I'm now seeing warnings like the following in our projects:
WARNING: Target "gmock" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case.
The above warning does not consider all scenarios where the EXCLUDE_FROM_ALL directory property is set before pulling in something with add_subdirectory()
. A project may do this but then only select the install components it is interested in for packaging, specifically excluding those install components that the above warning is talking about. We do this for almost all of our projects and the behavior is well-defined in the sense that because we don't ask for these targets to be installed in our packages, we don't open ourselves up to the sort of undefined behavior the warning mentions. This makes the warning overly pessimistic.