[CMake] Getting a list of all targets?

Clifford Yapp cliffyapp at gmail.com
Mon Sep 6 11:45:09 EDT 2010


Ah, I'm starting to get the idea now - the use of the _cmd-name effect
didn't click right away.  That just might do the trick - nifty!
Thanks everyone for your help!

CY

>> Well, if Michael's correct about the original form being available with an
>> _ prefix, then at least you wouldn't have to modify any sub-project build
>> files. Just
>>
>> function (add_library name ....)
>>   # do stuff to remember this target
>>   _add_library (name ....)
>> endfunction (add_library)
>>
>> Not 100% ideal, but a relatively small amount of work should get you what
>> you asked for initially, I think.
>>
>> Ceej
>> aka Chris Hillery
>
> This is the "right approach" for now. There is currently no way to iterate
> over targets in the CMakeLists files...
> HTH,
> David


More information about the CMake mailing list