[cmake-developers] Adding MacroWriteBasicCMakeVersionFile.cmake file to cmake ?

Alexander Neundorf neundorf at kde.org
Thu Jul 7 13:50:23 EDT 2011


On Thursday 07 July 2011, Brad King wrote:
> On 7/6/2011 4:00 PM, Alexander Neundorf wrote:
> > Since that Version.cmake file in most cases looks basically the same
> 
> They're only the same within a specific community's versioning scheme.
> The whole reason find_package loads package-provided version check
> files is to avoid imposing a versioning/compatibility scheme.  If
> we provide a template then we should name it after the scheme it
> follows.
> 
> Provide a module with macros to generate version files with different
> common schemes.  Use configure_file with CMakeConfigurableFile.in as
> the input if you don't want a custom .in file.

I'd do that, but when I first wrote that file, I was actually surprised that I 
could think of only one way to do it:

if (currentVersion < requestedVersion)
{
  compatible = false;
}
else
{
  compatible = true;
  if (currentVersion == requestedVersion)
  {
    exact = true;
  }
}


I think everything else are special cases, at least I can't think of other 
generic cases.
How could another common scheme look like ?

Alex



More information about the cmake-developers mailing list