[CMake] Getting a list of all targets?

Clifford Yapp cliffyapp at gmail.com
Mon Sep 6 01:06:57 EDT 2010


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.

Iterating over the targets at the end should be robust to any changes
to the rest of the make logic, and consequently is the more robust
long term approach.  Or perhaps someone has another way that doesn't
involve custom wrappers to ensure first-to-run ordering?

Cheers,
CY

On Mon, Sep 6, 2010 at 12:41 AM, Michael Wild <themiwi at gmail.com> wrote:
> AFAIK the original versions are prefixed with an underscore (_) if you override any of the built-in commands. But usually, it's preferable to call your custom function differently (e.g. prefix with the project name).
>
> You can add that special dependency code directly in the custom function, no need to iterate over all the targets at the end.


More information about the CMake mailing list