[cmake-developers] Generator options per-directory v. global

Brad King brad.king at kitware.com
Thu Oct 6 09:57:11 EDT 2016


On 10/05/2016 06:38 PM, Stephen Kelly wrote:
> The suggestion to use the first cmMakefile for these kinds of definitions is 
> a good one
> 
> 1) It can be documented that the variable can only be set in the top level
> 2) It is what people already do probably
> 3) It is more convenient than the API for setting cache or global properties

That makes sense, but the codelite feature is just following a
long-standing convention used for many settings.  If you want to
make a sweeping effort to formalize this kind of scoping then that
is fine with me.  Mostly I think it will be documenting that the
value of the variable at the end of the top-level CMakeLists.txt
file is the one that is used.  In some cases that may involve
fixing generators to actually use that one.

-Brad


More information about the cmake-developers mailing list