SYSTEM target property doesn't affect building the target itself
Originally reported in the context of FetchContent in this forum post: https://discourse.cmake.org/t/fetchcontent-declare-system-property-for-hierarchical-dependencies/9198 (but the underlying problem isn't specific to FetchContent).
The SYSTEM
target property only affects consumers that link to that target, not when building the target itself. This is also made clear by the SYSTEM
property's documentation. However, it could be argued that the SYSTEM
behavior should also apply when building that target too, at least in some situations. As the linked forum post demonstrates, there are scenarios where users will intuitively expect this to be the case.
Not sure what's the right way forward with this, but I'm opening this issue to discuss potential options.