On Thursday 23 July 2009, Sebastian Trüg wrote:
> On Wednesday 22 July 2009 13:04:04 David Faure wrote:
> > On Wednesday 15 July 2009, Christophe Giboudeaux wrote:
> > > On Monday 15 June 2009 20:08:14 Alexander Neundorf wrote:
> > > > Some general notes:
> > > > -modifying CMAKE_MODULE_PATH is only necessary for installed cmake
> > > > modules -every installed cmake module (at least from kdelibs) has to
> > > > be kept compatible at least until the end of KDE4,
> > > > -so in general, we shouldn't install too many such modules
> > > > -more specifically, if possible, modules beside kdelibs should not
> > > > install such cmake modules, but kdepimlibs is also a "libs" module,
> > > > so it is somewhat special
> >
> > Very interesting - soprano (from kdesupport trunk) installs a
> > <prefix>/share/apps/cmake/module/SopranoAddOntology.cmake
> > and this runs into the same problems as above:
> > if <prefix> is not the kde prefix then the cmake file won't be found by
> > include(SopranoAddOntology).
> >
> > A solution is to add the soprano prefix to $KDEDIRS (because
> > findkde4internal.cmake adds the paths from KDEDIRS to CMAKE_MODULE_PATH),
> > but that seems quite wrong (soprano isn't a kde thing, but a 3rd-party
> > thing...).
> >
> > The soprano prefix is in my CMAKE_PREFIX_PATH already, but cmake doesn't
> > know that it should look into /share/apps/cmake/modules in there of
> > course. Should FindKDE4Internal.cmake also add those dirs to
> > CMAKE_MODULE_PATH?
> >
> > Of course one can also export CMAKE_MODULE_PATH but I was hoping for a
> > more automated solution, we didn't have to set that var until now.
> >
> > Yeah I know that I run into more problems than others by having a
> > separate install prefix for kdesupport, but well, why not ;)
>
> I am very open to fix the install path in soprano.

For now I would suggest <prefix>/share/soprano/cmake/ (the path 
share/apps/cmake/modules/ is a left over from the beginning with cmake, and I 
think we can't change it now for the kdelibs stuff, but soprano is 
independent from that).

The attached patch doesn't change this, but it makes FindSoprano.cmake now 
also search the macros  file and load it. This way the macro is automatically 
available if soprano has been found successfully.

What do you think ?

Alex
Index: FindSoprano.cmake
===================================================================
--- FindSoprano.cmake	(revision 1001647)
+++ FindSoprano.cmake	(working copy)
@@ -47,6 +47,13 @@
     ${KDE4_INCLUDE_DIR}
     )
 
+  # find the cmake macro file installed by soprano, relative to the include dir
+  get_filename_component(_SOPRANO_PREFIX ${SOPRANO_INCLUDE_DIR} PATH)
+  find_file(_SOPRANO_MACRO_FILE NAMES SopranoAddOntology.cmake HINTS ${_SOPRANO_PREFIX}/share/apps/cmake/modules )
+  if(_SOPRANO_MACRO_FILE)
+    include(${_SOPRANO_MACRO_FILE})
+  endif(_SOPRANO_MACRO_FILE)
+
   find_library_with_debug(SOPRANO_INDEX_LIBRARIES 
     WIN32_DEBUG_POSTFIX d
     NAMES
@@ -84,9 +91,9 @@
 
   # check for all the libs as required to make sure that we do not try to compile with an old version
 
-  if(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES)
+  if(SOPRANO_INCLUDE_DIR  AND  SOPRANO_LIBRARIES  AND  _SOPRANO_MACRO_FILE)
     set(Soprano_FOUND TRUE)
-  endif(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES)
+  endif(SOPRANO_INCLUDE_DIR  AND  SOPRANO_LIBRARIES  AND  _SOPRANO_MACRO_FILE)
 
   if(Soprano_FOUND AND SOPRANO_INDEX_LIBRARIES)
     set(SopranoIndex_FOUND TRUE)
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to