[CMake] add_subdirectory inheritance

irukandji irukandji at voidptr.eu
Tue Apr 17 11:30:52 EDT 2012


Hi,

(as no one answered to my previous email, let me add this: 
multiplatform project with few million lines
of code, sheer size of the project is not allowing to turn around whole 
directory tree as price / performance
is a very relevant factor and even rewriting makefiles/vcprojs to cmake 
will take months)

The add_subdirectory inheritance striked which is practically a show 
stopper, it was already discussed here
http://www.mail-archive.com/cmake@cmake.org/msg34291.html What was 
proposed (DONT_INHERIT) was a great idea
and improvement to versability of CMake and also harmless for backward 
compatibility so i dont really
understand why forcing subproject to inherit all the settings.

Yes, what is added with add_subdirectory is not a child but a sibling 
or even some other part of the tree
but the point is that it doesnt stop the cmake from building it 
correctly but this inheritance is a problem
as it adds include directories to wrong versions of headers in public 
libs (due to bugs in different versions,
affecting different platforms,... the unification is impossible), the 
flags are used on wrong places etc.

Is there a way to workaround it?

Thank you.



More information about the CMake mailing list