<br>>> Is there also a way to disable recursive sub directory project inheritance<br>>> in CMake?<br>>I don't know what you mean by "project inheritance", but AFAIK it is not<br>>possible to disable inheriting settings from your parent directory.<br>
<br>In Microsoft VS land this would be:<br>Inherited Project Property Sheets<br><br>In Boost BJam - Boost Build V2<br>Project Hierarchies(see <a href="http://www.boost.org/doc/tools/build/doc/userman.pdf">http://www.boost.org/doc/tools/build/doc/userman.pdf</a>)<br>
<br>In the case of BJam:<br>"Projects inherit all attributes (such as requirements) from their parents. Inherited requirements are combined with any requirements<br>specified by the subproject. For example, if top/Jamroot has"<br>
<br>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<br>
<br>example of putting Jamfiles at leaves<br><br>/Jamroot<br>/myapps/build/Jamfile<br>/myapps/ap1/build/Jamfile<br>/myapps/ap1/src/somesrc.cpp<br>/mylib/build/Jamfile<br><br>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<br>
<br><br><br>>Instead of using cached variables, you might consider using global (user-<br>
>defined) properties. That's what I do when I need to "inherit", e.g., include<br>
>directories, across directory structures. Note that INCLUDE_DIRECTORIES is a<br>
>property of a directory. So you can always look up that property for a given<br>
>directory.<br><br>I was trying to avoid global anything, but I just can't seem to get around it.<br><br>Brian<br><br><br><br>