KDE/kdelibs
Alexander Neundorf
neundorf at kde.org
Mon Dec 14 23:29:27 CET 2009
On Monday 14 December 2009, Christophe Giboudeaux wrote:
> On Monday 14 December 2009 22:31:38 Alexander Neundorf wrote:
> > On Monday 14 December 2009, Christophe Giboudeaux wrote:
> > > Here's an example showing why the REQUIRED keyword may also be
> > > misleading:
> > >
> > > CMakeLists.txt:
> > >
> > > project(demo)
> > > cmake_minimum_required(VERSION 2.8)
> > > find_package(SharedDesktopOntologies 0.3 REQUIRED)
> > >
> > >
> > > SharedDesktopOntologies 0.3 doesn't exist. When running this
> > > CMakeLists.txt, the only information you will get is that:
> > >
> > > [quote]
> > > CMake Error at CMakeLists.txt:4 (find_package):
> > > Could not find module FindSharedDesktopOntologies.cmake or a
> > > configuration file for package SharedDesktopOntologies.
> > >
> > > Adjust CMAKE_MODULE_PATH to find FindSharedDesktopOntologies.cmake or
> > > set SharedDesktopOntologies_DIR to the directory containing a CMake
> > > configuration file for SharedDesktopOntologies. The file will have one
> > > of the following names:
> > >
> > > SharedDesktopOntologiesConfig.cmake
> > > shareddesktopontologies-config.cmake
> > >
> > >
> > > -- Configuring incomplete, errors occurred!
> > >
> > > [/quote]
> > >
> > > Which is totally wrong. The directory which contains
> >
> > Please post this to the cmake bugtracker at http://public.kitware.com/Bug
> > , that the error message is misleading in the case that there is "just" a
> > version mismatch.
> >
> > > SharedDesktopOntologiesConfig.cmake is in my CMAKE_PREFIX_PATH, if I
> > > change the minimum version to 0.2, CMake will find it.
> >
> > What we can do beside that, is to add a small
> > FindSharedDesktopOntologies.cmake, which will basically just wrap the
> > find_package(... NO_MODULE) call with a nicer error message.
>
> This file exists in kdelibs and creates two issues :
>
> 1/
> project(demo)
> cmake_minimum_required(VERSION 2.8)
> find_package(KDE4 REQUIRED)
> include(KDE4Defaults)
> find_package(SharedDesktopOntologies 0.3 REQUIRED)
>
> will claim that SharedDesktopOntologies is found:
>
> [quote]
> -- Found KDE 4.4 include dir: /usr/include
> -- Found KDE 4.4 library dir: /usr/lib
> -- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
> -- Found automoc4: /usr/bin/automoc4
> -- Found SharedDesktopOntologies: /usr/share/ontology
> -- Configuring done
> [/quote]
Well, there is no magic there and nothing which couldn't be changed.
I think version 0.1 is the version required for kdelibs ?
If that's wrong, which version is required ?
> 2/ in kdepim and kdepim-runtime, soprano and nepomuk are optional but
> SharedDesktopOntologies is required if nepomuk is not disabled and found on
> the system:
>
> macro_optional_find_package(Nepomuk)
> macro_log_feature(Nepomuk_FOUND "Nepomuk" "The Nepomuk libraries"
> "http://www.kde.org" FALSE "" "Nepomuk extends the search and tagging
> functionalities in KMail and Akonadi")
>
> # We require SharedDesktopOntology if nepomuk is enabled and was found on
> the system.
> if(WITH_Nepomuk AND Nepomuk_FOUND)
> find_package(SharedDesktopOntologies 0.2)
Oh, here version 0.2 is required.
Is it a good idea to require 0.1 in kdelibs and 0.2 in kdepim ?
Shouldn't we require 0.2 then also in kdelibs ?
Otherwise we get some partly support for all that I assume.
> macro_log_feature(SHAREDDESKTOPONTOLOGIES_FOUND "Shared desktop
> ontologies" "Desktop ontologies" "http://oscaf.sourceforge.net" TRUE "0.2"
> "Ontologies necessary for the Nepomuk semantic desktop.")
> endif(WITH_Nepomuk AND Nepomuk_FOUND)
>
> CMake will claim that SharedDesktopOntologies is found even if the wrong
> version is installed and it will claim that Nepomuk wasn't found if S.D.O
> is not installed
> The issue comes from FindNepomuk.cmake which calls
> FindSharedDesktopOntologies.cmake but doesn't require S.D.O:
> macro_log_feature(SHAREDDESKTOPONTOLOGIES_FOUND "Shared desktop ontologies"
> "Desktop ontologies" "http://oscaf.sourceforge.net" FALSE "" "Ontologies
> necessary for the Nepomuk semantic desktop.")
>
> If this is intentional, I have two alternatives:
> * Use find_package(SharedDesktopOntologies 0.2 NO_MODULE) but I end up with
> two SDO lines in the macro_display_feature_log output.
>
> * Use an option to enable our nepomuk agents and look for SDO before
> Nepomuk.
I am still unclear about the optional-ness of nepomuk and the required
versions of dependencies it needs...
Alex
More information about the Kde-buildsystem
mailing list