FetchContent + FeatureSummary
In an effort to make FetchContent cmake projects more in line with the logic of find_package
, there should be an option to add the imported projects as set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND ...)
. That way it can be reported via FeatureSummary, particularly if it was using FIND_PACKAGE_ARGS
.
Of course there is an ambiguity reported since it is reported as a package instead of external project. I am not sure what would be a good strategy for these, having a policy to add them as packages by default or creating another reporter for external projects in FeatureSummary, etc.
I was thinking of adding the set_property
to the upstream project, but I am not sure how to extract the name used in FetchContent_Declare
to use there. I was also thinking of doing this with Code Injection
, but then that is not ideal because CMAKE_PROJECT_INCLUDE
and such are only used as a single variable, not as a list right? Would also like some feedback on what do you guys think supporting FeatrueSummary
should look like in this context.
I have noticed FeatureSummary
hasn't received much love for 6 years, but that's a pity because after finding this, I think this has a lot of potential.