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

Brad King brad.king at kitware.com
Wed Jul 15 09:10:50 EDT 2015


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.  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.

-Brad



More information about the cmake-developers mailing list