aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Trueg <sebastian@trueg.de>2009-11-25 20:42:54 +0000
committerSebastian Trueg <sebastian@trueg.de>2009-11-25 20:42:54 +0000
commit7ae2155f81e026d49740e844dd6327e3f8a901fe (patch)
tree9679325a7565cb6e06e9f41bcba79e681bcbf73e
parentb290276613c9c0037eacc3f6d6e0f821d90d6054 (diff)
downloadextra-cmake-modules-7ae2155f81e026d49740e844dd6327e3f8a901fe.tar.gz
extra-cmake-modules-7ae2155f81e026d49740e844dd6327e3f8a901fe.tar.bz2
Added macro to find the new shared-desktop-ontologies package
svn path=/trunk/KDE/kdelibs/; revision=1054294
-rw-r--r--modules/CMakeLists.txt1
-rw-r--r--modules/FindNepomuk.cmake8
-rw-r--r--modules/FindSharedDesktopOntologies.cmake36
3 files changed, 44 insertions, 1 deletions
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index 33237a48..d0fda0f6 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -106,6 +106,7 @@ set(cmakeFiles CheckCXXSourceCompiles.cmake
FindSane.cmake
FindSasl2.cmake
FindSharedMimeInfo.cmake
+ FindSharedDesktopOntologies.cmake
FindSoprano.cmake
FindSqlite.cmake
FindStrigi.cmake
diff --git a/modules/FindNepomuk.cmake b/modules/FindNepomuk.cmake
index 24832973..b9f7b820 100644
--- a/modules/FindNepomuk.cmake
+++ b/modules/FindNepomuk.cmake
@@ -22,6 +22,12 @@ if (NOT DEFINED Soprano_FOUND)
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)
+ 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)
+
# Check for the following stuff independent from whether soprano has been found
# or not. This will give a better error message at the end.
find_path(NEPOMUK_INCLUDE_DIR
@@ -55,7 +61,7 @@ include(FindPackageHandleStandardArgs)
# 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
+ Soprano_FOUND SOPRANO_PLUGIN_RAPTORPARSER_FOUND SOPRANO_PLUGIN_REDLANDBACKEND_FOUND DESKTOP_ONTOLOGIES_FOUND
)
#to retain backward compatibility
diff --git a/modules/FindSharedDesktopOntologies.cmake b/modules/FindSharedDesktopOntologies.cmake
new file mode 100644
index 00000000..c0ebb37d
--- /dev/null
+++ b/modules/FindSharedDesktopOntologies.cmake
@@ -0,0 +1,36 @@
+# - Try to find shared-desktop-ontologies
+# Once done this will define
+#
+# DESKTOP_ONTOLOGIES_FOUND - system has shared-desktop-ontologies
+# DESKTOP_ONTOLOGIES_DIR - Folder where the ontologies are stored
+# DESKTOP_ONTOLOGIES_VERSION - version number of shared-desktop-ontologies
+
+# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+IF (DESKTOP_ONTOLOGIES_DIR)
+ # in cache already
+ SET(SharedDesktopOntologies_FIND_QUIETLY TRUE)
+ENDIF (DESKTOP_ONTOLOGIES_DIR)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ PKG_SEARCH_MODULE( DESKTOP_ONTOLOGIES shared-desktop-ontologies )
+ set(DESKTOP_ONTOLOGIES_DIR ${DESKTOP_ONTOLOGIES_PREFIX}/share/ontology)
+ENDIF (NOT WIN32)
+
+IF (DESKTOP_ONTOLOGIES_FOUND)
+ IF (NOT SharedDesktopOntologies_FIND_QUIETLY)
+ MESSAGE(STATUS "Found SharedDesktopOntologies ${DESKTOP_ONTOLOGIES_VERSION}: ${DESKTOP_ONTOLOGIES_DIR}")
+ ENDIF (NOT SharedDesktopOntologies_FIND_QUIETLY)
+ELSE (DESKTOP_ONTOLOGIES_FOUND)
+ IF (SharedDesktopOntologies_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find SharedDesktopOntologies, check FindPkgConfig output above!")
+ ENDIF (SharedDesktopOntologies_FIND_REQUIRED)
+ENDIF (DESKTOP_ONTOLOGIES_FOUND)
+
+MARK_AS_ADVANCED(DESKTOP_ONTOLOGIES_DIR)