[RFC] cmake modules and keeping source compatibility
Sebastian TrĂ¼g
strueg at mandriva.com
Fri Jan 18 21:35:01 GMT 2008
As for Soprano is the attached patch ok?
On Friday 18 January 2008 19:17:02 Alexander Neundorf wrote:
> Hi,
>
> we are shipping KDE 4.0.0 now and so have to keep source compatibility.
> This means also that the cmake files installed on the users systems have to
> stay compatible.
> Here is a document describing what needs to be taken care of:
> http://techbase.kde.org/index.php?title=Policies/CMake_and_Source_Compatibi
>lity Please comment on it.
>
> Two more things:
> -do we need to keep source compatibility for all cmake files from all
> modules or is kdelibs enough ? If kdelibs would be enough, this would
> simply mean that the other modules like kdebase don't install their cmake
> files.
>
> There were a few commits already which change cmake modules so that a
> higher version of the respective library is now required, otherwise they
> fail. Please comment.
>
> I'm afraid this is also source incompatible:
> > SVN commit 762185 by trueg:
> >
> > Min Soprano version is now 2.0
> >
> > --- trunk/KDE/kdelibs/cmake/modules/FindSoprano.cmake #762184:762185
> > @@ -79,10 +79,10 @@
> > STRING(REGEX MATCH "SOPRANO_VERSION_STRING \".*\"\n"
> > SOPRANO_VERSION_MATCH ${SOPRANO_VERSION_CONTENT}) IF
> > (SOPRANO_VERSION_MATCH)
> > STRING(REGEX REPLACE "SOPRANO_VERSION_STRING \"(.*)\"\n" "\\1"
> > SOPRANO_VERSION ${SOPRANO_VERSION_MATCH}) - if(SOPRANO_VERSION
> > STRLESS "1.99")
> > + if(SOPRANO_VERSION STRLESS "2.0")
> > set(Soprano_FOUND FALSE)
> > - message(FATAL_ERROR "Soprano version ${SOPRANO_VERSION} is too
> > old. Please install 1.99 or newer") - endif(SOPRANO_VERSION STRLESS
> > "1.99")
> > + message(FATAL_ERROR "Soprano version ${SOPRANO_VERSION} is too
> > old. Please install 2.0 or newer") + endif(SOPRANO_VERSION STRLESS
> > "2.0")
> > ENDIF (SOPRANO_VERSION_MATCH)
> > endif(Soprano_FOUND)
>
> I'm not sure we may do such changes now.
>
> The change has the effect that a cmake module now fails (if the soprano
> version is too old), whereas with the previous version it worked.
>
> If there is a 3rd party application which also uses FindSoprano.cmake,
> installed with KDE, it may not build anymore after an update of KDE.
> Insofar this could be considered a source incompatible change, which we
> must not do.
>
> A better approach would be not to hardcode the required version in the
> cmake module, but to set it from the outside:
>
> set(SOPRANO_REQUIRED_VERSION 2.0)
> find_package(Soprano REQUIRED)
>
> and then compare with SOPRANO_REQUIRED_VERSION in FindSoprano.cmake.
>
> This issue is not specific to FindSoprano.cmake, there was also a similar
> commit to FindSharedMimeInfo.cmake.
>
> One could argue that if a KDE is installed which has this version of
> FindSoprano, then the correct version of Soprano is installed anyways. But
> this must not be true. It could be an optional package in KDE (so KDE still
> builds without it), but it could be a required package for the 3rd party
> application, which would then fail to build (and which doesn't require the
> newer version).
>
> So I'm afraid this is really a source incompatible change and must be
> reverted.
>
> Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soprano-cmake.diff
Type: text/x-diff
Size: 1938 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080118/e347ef65/attachment.diff>
More information about the kde-core-devel
mailing list