[cmake-developers] Ideas on Properties

Ken Martin ken.martin at kitware.com
Tue Oct 24 11:13:38 EDT 2006


> > ...stuff about wrapping C++ objects ...
> I don't like this.  It is too direct and low-level.

I agree. Just listed it for completeness.


 
> > Another idea is to add CMake commands to work with properties. For
ables. We also have a bunch of SET_TARGET_PROPERTIES type commands


> Can you give examples of how some current global vars would be
> implemented in this framework?

I've been working on this and thinking a bit more. So the variables that are
compiled into CMake (in that cmake reads them to control some aspect of its
behavior) will be defined using a C++ version of DefineProperty. The main
value in this is that it provides a mechanism to document these many
variables and provides some more formality to the process. This is pretty
straight forward and integrates well with the current cmDocumentation class.
The problem is with properties that are used solely by modules or list
files. To the CMake user these look like properties as well but the current
help mechanism does not support displaying help specific to a project (i.e.
after parsing the list files and modules). I'm sure we could add this is
without too much grief so it isn't a huge issue.


> On the other hand all these settings are things that are tested by C++
> code at generate time and generally ignored by CMakeLists.txt code
> (other than setting).  If we formalized some of the Property map ivars
> in cmSourceFile, cmTarget, etc. to map some properties directly to other
> ivars then setting/getting would not need a change to the CMake
> language.  As part of the formalization we would add documentation
> strings to all such properties in the C++ code.

Actually the current SET_TARGET_PROPERTIES (and kin) can be used to do most
of this. In fact I still waffle between introducing new commands that are
general and just sticking with the existing commands that mostly work. Most
of the changes here would be under the hood to how properties are stored and
documented. 




More information about the cmake-developers mailing list