[cmake-developers] Listing all targets (was: Wrapping functions in CMake)

Clifford Yapp cliffyapp at gmail.com
Thu Jul 16 11:42:00 EDT 2015


On Wed, Jul 15, 2015 at 9:10 AM, Brad King <brad.king at kitware.com> wrote:
> On 07/10/2015 03:42 PM, Clifford Yapp wrote:
>> On Thu, Jul 9, 2015 at 1:35 PM, Clifford Yapp <cliffyapp at gmail.com> wrote:
>>
>>> 2.  Provide similar lists of all defined targets for the various types
>>> (e.g. CMAKE_EXECUTABLE_TARGETS, CMAKE_LIBRARY_TARGETS,
>>> CMAKE_CUSTOM_TARGETS).
>>
>> Looking into the CMake sources, it seems like this information is
>> stored already in the global target map - what would be the "correct"
>> way to expose that information in variables in CMake script space?
>
> We shouldn't need separate lists for each because one can check
> the TYPE target property given the target name.

Ah, good point.

> The list of globally-scoped (non-imported) targets could be made available
> through a (read-only) global property whose implementation
> computes the list on the fly.

Sounds workable - are there any pre-existing properties like that that
can serve as a guide for implementation?

Thanks,
CY


More information about the cmake-developers mailing list