[CMake] Getting a list of all targets?

Michael Wild themiwi at gmail.com
Mon Sep 6 03:36:55 EDT 2010


On 6. Sep, 2010, at 9:21 , Chris Hillery wrote:

> On Sun, Sep 5, 2010 at 10:06 PM, Clifford Yapp <cliffyapp at gmail.com> wrote:
> 
>> I was hoping I wouldn't need to do a custom wrapper for every target,
>> particularly since I'm building some sub-projects using foreign
>> CMakeLists.txt files and I'd really rather not change them from their
>> default state - that's an extra maintainance burden and one of the
>> advantages I'm most hoping for with CMake is to be able to use
>> external build logic without altering it.
>> 
> 
> 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


There is one problem, though: What if one of the sub-projects also overrides the commands?

Michael

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100906/caf3f98a/attachment.pgp>


More information about the CMake mailing list