Alexander Neundorf wrote:
> On Thursday 26 November 2009, Sebastian Trueg wrote:
>> Well, I see now that my action was not the greatest. I apologize.
>> However, disabling Nepomuk altogether is not a solution either. What is
>> so broken about the cmake file anyway? "not in an acceptable state" does
>> not tell me anything.
>> I am more than willing to improve the situation.
> 
> Great :-)
> 
> What is broken:
> as I wrote in reply to your commit:
> http://techbase.kde.org/Policies/CMake_Coding_Style#.28Not.29_Using_pkg-config
> 
> "the FindXXX.cmake must also work without pkg-config, as long as the package 
> is either installed to one of the default locations (as /usr or /usr/local) 
> or if CMAKE_PREFIX_PATH is set accordingly"
> 
> This was so not the case, I mean it basically consisted of
> 
> if(NOT WIN32)
>    use pkg-config...
> endif(NOT WIN32)
> 
> which means it also broke Windows 100%.
> 
> It also didn't follow the commit policy for public cmake modules in kdelibs 
> at 
> all. And you committed that after you broke source compatibility by removing 
> FindKonto.cmake and FindKNepomuk.cmake just a few hours earlier, and you 
> should have received my email about that earlier breakage already.
> 
> kdelibs/cmake/modules/FindLibXml2.cmake is a good example how to use 
> pkg-config if you really want to (we don't need it, you just have to set the 
> CMAKE_PREFIX_PATH environment variable to contain the install prefix of the 
> respective package and it will be found).
> 
> Then, please post it to kde-buildsystem (k-c-d) is also ok, and wait for an 
> explicit ok:
> http://techbase.kde.org/Policies/CMake_Commit_Policy

here we go: the attached patch should integrate all your suggestions.
Please have a look.

> Also, does this file have to be installed ?
> I.e. are is it used by modules besides kdelibs ?

Yes. It is even checked in FindNepomuk.cmake.


> P.S. and please also explain what's up with FindKonto.cmake and 
> FindKNepomuk.cmake.

They are both from pre-KDE 4.0 times. I have no idea why we still have
them in there. I suspect that I simply forgot to remove them. After all
what is Nepomuk today (and was so in 4.0) had at least two different
names during development.

So I doubt anyone ever used the cmake macros. If so they never found
anything. So I think they can safely be removed. But at least they can
be cleaned out.

Cheers,
Sebastian
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 1054513)
+++ CMakeLists.txt      (working copy)
@@ -96,7 +96,7 @@
 macro_log_feature(SOPRANO_PLUGIN_REDLANDBACKEND_FOUND "Soprano Redland 
Backend" "Redland storage backend for Soprano" "http://soprano.sourceforge.net"; 
FALSE "" "The Soprano redland backend is required to build the Nepomuk semantic 
desktop system.")
 
 macro_optional_find_package(SharedDesktopOntologies)
-macro_log_feature(DESKTOP_ONTOLOGIES_FOUND "Shared desktop ontologies" 
"Desktop ontologies" "http://oscaf.sourceforge.net"; FALSE "" "Ontologies 
necessary for the Nepomuk semantic desktop.")
+macro_log_feature(SHAREDDESKTOPONTOLOGIES_FOUND "Shared desktop ontologies" 
"Desktop ontologies" "http://oscaf.sourceforge.net"; FALSE "" "Ontologies 
necessary for the Nepomuk semantic desktop.")
 
 macro_optional_find_package(QCA2)
 macro_log_feature(QCA2_FOUND "QCA2" "Qt Cryptographic Architecture" 
"http://delta.affinix.com/qca"; FALSE "2.0.0" "Needed for the plasma remote 
widgets functionality.")
@@ -227,10 +227,10 @@
 
 # Actually nepomuk is not optional, without it other KDE modules don't build,
 # so this must be fixed. Alex
-if(DESKTOP_ONTOLOGIES_FOUND)
+if(Soprano_FOUND AND SHAREDDESKTOPONTOLOGIES_FOUND)
   set(HAVE_NEPOMUK true)
   add_subdirectory(nepomuk)
-endif(DESKTOP_ONTOLOGIES_FOUND)
+endif(Soprano_FOUND AND SHAREDDESKTOPONTOLOGIES_FOUND)
 
 ################# list the subdirectories #################
 
Index: cmake/modules/FindSharedDesktopOntologies.cmake
===================================================================
--- cmake/modules/FindSharedDesktopOntologies.cmake     (revision 1054555)
+++ cmake/modules/FindSharedDesktopOntologies.cmake     (working copy)
@@ -1,4 +1,41 @@
-# This module was committed without any review or announcement and in a not 
acceptable state, so disable it for now. Alex
-message(STATUS "FindSharedDesktopOntologies.cmake is just a placeholder until 
a reviewed module is committed")
+# - Try to find shared-desktop-ontologies
+# The shared-desktop-ontologies package is a direct dependancy of the Nepomuk
+# semantic desktop system and provides all necessary ontology files like
+# RDF, RDFS, NRL, or NIE.
+#
+# The package is created by the OSCAF project (http://oscaf.sourceforge.net).
+#
+# Once done this will define
+#
+#  SHAREDDESKTOPONTOLOGIES_FOUND    - system has shared-desktop-ontologies
+#  SHAREDDESKTOPONTOLOGIES_ROOT_DIR - Folder where the ontologies are stored
+#
 
-set(DESKTOP_ONTOLOGIES_DIR "")
+# Copyright (c) 2009, Sebastian Trueg, <[email protected]>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+   # in cache already
+   set(SHAREDDESKTOPONTOLOGIES_FIND_QUIETLY TRUE)
+endif (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+
+find_path (SHAREDDESKTOPONTOLOGIES_ROOT_DIR
+  nie/nie.trig
+  PATHS
+  /usr/share
+  /usr/local/share
+  ${SHARE_INSTALL_PREFIX}
+  ENV XDG_DATA_DIRS
+  PATH_SUFFIXES ontology
+)
+
+if (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+  set (SHAREDDESKTOPONTOLOGIES_FOUND 1)
+endif (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+
+mark_as_advanced(SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SharedDesktopOntologies DEFAULT_MSG 
SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
Index: cmake/modules/FindNepomuk.cmake
===================================================================
--- cmake/modules/FindNepomuk.cmake     (revision 1054555)
+++ cmake/modules/FindNepomuk.cmake     (working copy)
@@ -22,11 +22,11 @@
   macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop Storing" "" 
FALSE "" "Soprano is needed for Nepomuk")
 endif (NOT DEFINED Soprano_FOUND)
 
-if (NOT DEFINED DESKTOP_ONTOLOGIES_FOUND)
+if (NOT DEFINED SHAREDDESKTOPONTOLOGIES_FOUND)
   find_package(SharedDesktopOntologies)
   include(MacroLogFeature)
-  macro_log_feature(DESKTOP_ONTOLOGIES_FOUND "Shared desktop ontologies" 
"Desktop ontologies" "http://oscaf.sourceforge.net"; FALSE "" "Ontologies 
necessary for the Nepomuk semantic desktop.")
-endif (NOT DEFINED DESKTOP_ONTOLOGIES_FOUND)
+  macro_log_feature(SHAREDDESKTOPONTOLOGIES_FOUND "Shared desktop ontologies" 
"Desktop ontologies" "http://oscaf.sourceforge.net"; FALSE "" "Ontologies 
necessary for the Nepomuk semantic desktop.")
+endif (NOT DEFINED SHAREDDESKTOPONTOLOGIES_FOUND)
 
 # Check for the following stuff independent from whether soprano has been found
 # or not. This will give a better error message at the end.
@@ -61,7 +61,7 @@
 # easier for the user to see what was missing:
 find_package_handle_standard_args(Nepomuk  DEFAULT_MSG 
                                   NEPOMUK_LIBRARIES NEPOMUK_INCLUDE_DIR
-                                  Soprano_FOUND 
SOPRANO_PLUGIN_RAPTORPARSER_FOUND SOPRANO_PLUGIN_REDLANDBACKEND_FOUND 
DESKTOP_ONTOLOGIES_FOUND
+                                  Soprano_FOUND 
SOPRANO_PLUGIN_RAPTORPARSER_FOUND SOPRANO_PLUGIN_REDLANDBACKEND_FOUND 
SHAREDDESKTOPONTOLOGIES_FOUND
                                   )
 
 #to retain backward compatibility
Index: nepomuk/core/CMakeLists.txt
===================================================================
--- nepomuk/core/CMakeLists.txt (revision 1054513)
+++ nepomuk/core/CMakeLists.txt (working copy)
@@ -52,9 +52,9 @@
   graphwrapper.cpp
 )
 
-soprano_add_ontology(nepomuk_LIB_SRCS "${DESKTOP_ONTOLOGIES_DIR}/nie/nie.trig" 
"NIE" "Nepomuk::Vocabulary" "trig")
-soprano_add_ontology(nepomuk_LIB_SRCS "${DESKTOP_ONTOLOGIES_DIR}/nie/nfo.trig" 
"NFO" "Nepomuk::Vocabulary" "trig")
-soprano_add_ontology(nepomuk_LIB_SRCS 
"${DESKTOP_ONTOLOGIES_DIR}/pimo/pimo.trig" "PIMO" "Nepomuk::Vocabulary" "trig")
+soprano_add_ontology(nepomuk_LIB_SRCS 
"${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig" "NIE" "Nepomuk::Vocabulary" 
"trig")
+soprano_add_ontology(nepomuk_LIB_SRCS 
"${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig" "NFO" "Nepomuk::Vocabulary" 
"trig")
+soprano_add_ontology(nepomuk_LIB_SRCS 
"${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/pimo/pimo.trig" "PIMO" 
"Nepomuk::Vocabulary" "trig")
 
 kde4_add_library(nepomuk SHARED ${nepomuk_LIB_SRCS})
 
Index: nepomuk/query/CMakeLists.txt
===================================================================
--- nepomuk/query/CMakeLists.txt        (revision 1054513)
+++ nepomuk/query/CMakeLists.txt        (working copy)
@@ -33,7 +33,7 @@
 )
 
 include(SopranoAddOntology)
-soprano_add_ontology(nepomukquery_SRC "${DESKTOP_ONTOLOGIES_DIR}/nie/nie.trig" 
"NIE" "Nepomuk::Vocabulary" "trig")
+soprano_add_ontology(nepomukquery_SRC 
"${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig" "NIE" "Nepomuk::Vocabulary" 
"trig")
 
 set_source_files_properties(
   org.kde.nepomuk.QueryService.xml
_______________________________________________
Kde-buildsystem mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-buildsystem

Reply via email to