KDE/kdelibs/cmake/modules
Alexander Neundorf
neundorf at kde.org
Thu Sep 3 20:02:38 CEST 2009
On Wednesday 02 September 2009, Alexander Neundorf wrote:
> On Tuesday 01 September 2009, Raphael Kubo da Costa wrote:
> > 2009/9/1 Dario Freddi <drf54321 at gmail.com>:
> > > In every application using KAuth. Should I just put some comments or
> > > there's a syntax for that? usage guide is already in the kauth
> > > MainPage.dox
> >
> > All CMake files in kdelibs should have documentation at the top,
> > basically describing what it does and what variables are set. Just
> > take a look at the other files in the same directory ;)
>
> Also, this file is now already in kdelibs, but I didn't find anything else
> kauth related in kdelibs/cmake/modules/. What am I missing ?
Ok, I missed that kauth is a subdir in kdecore/.
So kauth is part of the kdecore library. This means that it is available for
every user of kdelibs.
This means that the macros necessary for it should be directly in
KDE4Macros.cmake.
Please add the two macros there, add the names of the macros to the list of
macros at the top of KDE4Macros.cmake and add full documentation of the
macros at the top of FindKDE4Internal.cmake.
Now that it is part of kdecore the searching for the installed files is not
really necessary anymore.
kauth/dbus_service.stub and kauth/dbus_policy.stub will be installed to
${DATA_INSTALL_DIR}, which is ${KDE4_DATA_INSTALL_DIR} for everybody outside
kdelibs.
So you can basically just use ${KDE4_DATA_INSTALL_DIR}/kauth/dbus_service.stub
and ${KDE4_DATA_INSTALL_DIR}/kauth/dbus_policy.stub directly in the macros
(we also don't check for the existence of every single installed other file
of kdelibs, like e.g. every single header).
If you really want to be sure, you can use
find_file(_kauth_really_exists
NAMES kauth/dbus_policy.stub
PATHS ${KDE4_DATA_INSTALL_DIR}
NO_DEFAULT_PATH)
or
if(EXISTS ${KDE4_DATA_INSTALL_DIR}/kauth/dbus_policy.stub)
to check whether the file really does exist (but it shouldn't be necessary).
The proper way to check that would be to increase the kdelibs version number
and require the appropriate version in the KDE modules needing kauth.
The executable kauth-policy-gen should be handled like e.g. meinproc4.
This means when installing it, it should be added to
the "export-set" "kdelibsToolsTargets", which is a set of targets which
are "exported" into a special cmake file which is installed when installing
kdelibs (see bottom of kdelibs/CMakeLists.txt). Then later on in
FindKDE4Internal.cmake the LOCATION property of the then imported target
should be used to set KDE4_KDE4_KAUTH_POLICY_GEN (which should be renamed to
KDE4_KAUTH_POLICY_GEN_EXECUTABLE).
The file MacroKAuth.cmake can then be removed. To give people a hint why their
build suddenly breaks if the still have include(MacroKAuth) somewhere, you
can replace the contents of MacroKAuth.cmake for some time with just:
message(FATAL_ERROR "Don't include(MacroKAuth) anymore, it's now included in
find_package(KDE4)")
Alex
More information about the Kde-buildsystem
mailing list