[CMake] problem with ADD_SUBDIRECTORY always inheriting all settings

John Drescher drescherjm at gmail.com
Tue Feb 1 17:43:44 EST 2011


On Tue, Feb 1, 2011 at 5:36 PM, Maarten Nieber <hallomaarten at yahoo.com> wrote:
> Hi John,
> thanks, but that only works one level deep, right? If you have a structure A
> -> B -> C, then C will always inherit all of A, regardless of where in B's
> CMakeList you put the ADD_SUBDIRECTORY.

No it depends where you put add_subdirectory on each level. Basically
any variable set (or other setting) before the call of
add_subdirectory will be inherited. If you put add_subdirectory as the
second line of each level (just after the project line) i do not
believe anything will be inherited from a to c.

John


More information about the CMake mailing list