[CMake] Inherited project settings

Brian Davis bitminer at gmail.com
Wed Feb 3 15:54:22 EST 2010


>> Is there also a way to disable recursive sub directory project
inheritance
>> in CMake?
>I don't know what you mean by "project inheritance", but AFAIK it is not
>possible to disable inheriting settings from your parent directory.

In Microsoft VS land this would be:
Inherited Project Property Sheets

In Boost BJam - Boost Build V2
Project Hierarchies(see http://www.boost.org/doc/tools/build/doc/userman.pdf
)

In the case of BJam:
"Projects inherit all attributes (such as requirements) from their parents.
Inherited requirements are combined with any requirements
specified by the subproject. For example, if top/Jamroot has"

Which is sadly the same case for CMake.  However in BJam this could be
rectified (I never thought this was a good idea to begin with) by putting
Jamfiles(s) at leaves and then calling as usual "use-project" which would
inherit only from a specified project

example of putting Jamfiles at leaves

/Jamroot
/myapps/build/Jamfile
/myapps/ap1/build/Jamfile
/myapps/ap1/src/somesrc.cpp
/mylib/build/Jamfile

In above form when BJam recursed into /myapps/ap1/build/Jamfile and followed
up the tree to Jamroot it would not "see" /myapps/ap1/build/Jamfile project
settings unless specified explicitly by "use-project".  Nice thing about
BJam was I could create my own project "directory" structure completely
independent of the source tree strucutre



>Instead of using cached variables, you might consider using global (user-
>defined) properties. That's what I do when I need to "inherit", e.g.,
include
>directories, across directory structures. Note that INCLUDE_DIRECTORIES is
a
>property of a directory. So you can always look up that property for a
given
>directory.

I was trying to avoid global anything, but I just can't seem to get around
it.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100203/9e66321c/attachment.htm>


More information about the CMake mailing list