[CMake] Getting a list of all targets?
david.cole at kitware.com
Mon Sep 6 09:21:22 EDT 2010
On Mon, Sep 6, 2010 at 3:21 AM, Chris Hillery <chillery-cmake at lambda.nu>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.
> aka Chris Hillery
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> Please keep messages on-topic and check the CMake FAQ at:
> Follow this link to subscribe/unsubscribe:
This is the "right approach" for now. There is currently no way to iterate
over targets in the CMakeLists files...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the CMake