extra-cmake-modules: ECM_VERSION() macro

Alexander Neundorf neundorf at kde.org
Wed Nov 30 18:59:08 UTC 2011


On Wednesday 30 November 2011, Alexander Neundorf wrote:
> On Wednesday 30 November 2011, Stephen Kelly wrote:
> > Alexander Neundorf wrote:
> > > Hi,
> > > 
> > > in extra-cmake-modules we have a file ECMVersion.cmake, which contains
> > > a macro ecm_version().
> > > 
> > > This macro is not documented, and "ecm_version()" is not a good name
> > > for a function (or macro), since it doesn't contain a verb.
> > > 
> > > How is this macro intended to be used ?
> > > Is it intended to be "public" or is it used only internally ?
> > > 
> > > We have to be careful, once we ship a release we must keep
> > > compatibility.
> > > 
> > > Alex
> > 
> > Each framework uses it in the frameworks branch. The idea is to have a
> > compact way to set the version which could be updated by scripty (as
> > there may be many more places where the version needs to be updated on
> > release)
> 
> Can you please add documentation to it ?
> How about changing the name to ecm_declare_version_variables() or something
> like that ?
> ecm_declare_version(), ecm_set_version_variables(), ...
> It really should have a verb in it.

How about
ecm_set_version_variables( [PREFIX prefix] VERSION x y z) ?

with the prefix defaulting to "ECM" is not given.
In my own projects, I would prefer to have variables like
FOO_VERSION_STRING instead if ECM_VERSION_STRING, since this sounds like it 
contains the version string of the extra-cmake-modules which is in use.

I also started with simple macros which don't take parameter keywords, and in 
many cases over time it became necessary to add more options, which made it 
necessary to add keywords.
So, in general it's better to add such keywords to the syntax.
They can be relatively easily parsed using CMakeParseArguments.cmake.

Alex


More information about the Kde-buildsystem mailing list