[CMake] Getting a list of all targets?

Chris Hillery chillery-cmake at lambda.nu
Mon Sep 6 03:21:21 EDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100906/f3172c31/attachment.htm>


More information about the CMake mailing list