[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim-runtime] e1c959a: Provide an option to build without nepomuk
From:       Till Adam <till () kdab ! com>
Date:       2010-12-22 15:29:23
Message-ID: 20101222152923.DD4CAA6090 () git ! kde ! org
[Download RAW message or body]

commit e1c959a35409c2a582ebe8e5444d0c75866e97dd
branch master
Author: Till Adam <till@kdab.com>
Date:   Wed Dec 22 15:17:08 2010 +0100

    Provide an option to build without nepomuk support and honor it.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc7c26f..462927c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,12 @@ project(kdepim-runtime)
 # where to look first for cmake modules. This line must be the first one or cmake \
will use the system's FindFoo.cmake  set(CMAKE_MODULE_PATH \
${kdepim-runtime_SOURCE_DIR}/cmake/modules)  
+############### search-related options ################
+option(KDEPIM_NO_NEPOMUK "Build without nepomuk dependency" FALSE)
+
+if(KDEPIM_NO_NEPOMUK)
+  add_definitions(-DKDEPIM_NO_NEPOMUK)
+endif(KDEPIM_NO_NEPOMUK)
 
 ############### search packages used by KDE ###############
 
@@ -27,6 +33,8 @@ macro_log_feature(LIBXML2_FOUND "LibXML2" "Libraries used to \
develop XML applica  set(SDO_MIN_VERSION 0.2)
 set(SOPRANO_MIN_VERSION 2.3.70)
 
+if(NOT KDEPIM_NO_NEPOMUK)
+
 find_package(SharedDesktopOntologies ${SDO_MIN_VERSION})
 macro_log_feature(SHAREDDESKTOPONTOLOGIES_FOUND "Shared desktop ontologies" "Desktop \
ontologies" "http://oscaf.sourceforge.net" TRUE "${SDO_MIN_VERSION}" "Ontologies \
necessary for the Nepomuk semantic desktop.")  
@@ -36,6 +44,12 @@ macro_log_feature(Soprano_FOUND "Soprano" "Semantic Desktop \
Storing" "http://sop  find_package(Nepomuk)
 macro_log_feature(Nepomuk_FOUND "Nepomuk" "The Nepomuk libraries" \
"http://www.kde.org" TRUE "" "Nepomuk extends the search and tagging functionalities \
in KMail and Akonadi")  
+else( NOT KDEPIM_NO_NEPOMUK )
+
+message( STATUS "Skipping detection of Nepomuk dependencies, feature is disabled." )
+
+endif(NOT KDEPIM_NO_NEPOMUK)
+
 find_package(Strigi)
 macro_log_feature(STRIGI_FOUND "Strigi" "Index metadata of files" \
"http://strigi.sourceforge.net" FALSE "" "")  
diff --git a/agents/CMakeLists.txt b/agents/CMakeLists.txt
index f865377..841a6b2 100644
--- a/agents/CMakeLists.txt
+++ b/agents/CMakeLists.txt
@@ -20,7 +20,7 @@ if(NOT WINCE)
 add_subdirectory( invitations )
 add_subdirectory( calendarsearch )
 
-if( Nepomuk_FOUND AND STRIGI_FOUND )
+if( NOT KDEPIM_NO_NEPOMUK AND Nepomuk_FOUND AND STRIGI_FOUND )
     include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/nepomukfeeder \
${CMAKE_CURRENT_BINARY_DIR}/ontologies ${SOPRANO_INCLUDE_DIR} ${STRIGI_INCLUDE_DIR})  \
                set( NEPOMUKFEEDER_SHARED_SRCS
          ${CMAKE_CURRENT_SOURCE_DIR}/nepomukfeeder/nepomukfeederagentbase.cpp
@@ -42,5 +42,5 @@ if( Nepomuk_FOUND AND STRIGI_FOUND )
     add_subdirectory( ontologies )
     add_subdirectory( nepomuk_contact_feeder )
     add_subdirectory( nepomuk_calendar_feeder )
-endif( Nepomuk_FOUND AND STRIGI_FOUND )
+endif( NOT KDEPIM_NO_NEPOMUK AND Nepomuk_FOUND AND STRIGI_FOUND )
 endif(NOT WINCE)
diff --git a/migration/kmail/CMakeLists.txt b/migration/kmail/CMakeLists.txt
index 7c81281..ed1ae0d 100644
--- a/migration/kmail/CMakeLists.txt
+++ b/migration/kmail/CMakeLists.txt
@@ -40,12 +40,14 @@ add_resource_iface( maildir/maildirresource.kcfg
 add_resource_iface( mixedmaildir/mixedmaildirresource.kcfg
                     org.kde.Akonadi.MixedMaildir.Settings MixedMaildirSettings )
 
+if ( NOT KDEPIM_NO_NEPOMUK )
 soprano_add_ontology(kmail-migrator_srcs
   ${CMAKE_CURRENT_SOURCE_DIR}/messagetag.trig
   "MessageTag"
   "Vocabulary"
   "trig"
 )
+endif ( NOT KDEPIM_NO_NEPOMUK )
 
 kde4_add_app_icon(kmail-migrator_srcs "${KDE4_ICON_DIR}/oxygen/*/apps/akonadi.png")
 kde4_add_executable(kmail-migrator ${kmail-migrator_srcs} )
diff --git a/migration/kmail/kmailmigrator.cpp b/migration/kmail/kmailmigrator.cpp
index b0a480b..30e6f6b 100644
--- a/migration/kmail/kmailmigrator.cpp
+++ b/migration/kmail/kmailmigrator.cpp
@@ -24,9 +24,12 @@
 
 #include "messagetag.h"
 
+#ifndef KDEPIM_NO_NEPOMUK
 // avoid metatype.h from interfering
 #include <Nepomuk/Variant>
 #define POP3_METATYPE_H
+#include <Nepomuk/Tag>
+#endif
 
 #include "imapsettings.h"
 #include "pop3settings.h"
@@ -51,8 +54,6 @@ using Akonadi::AgentManager;
 using Akonadi::AgentInstance;
 using Akonadi::AgentInstanceCreateJob;
 
-#include <Nepomuk/Tag>
-
 #include <KConfig>
 #include <KConfigGroup>
 #include <KDebug>
@@ -215,6 +216,7 @@ void KMailMigrator::migrateTags()
 
     const QString shortcut = group.readEntry( QLatin1String( "shortcut" ), QString() \
);  
+#ifndef KDEPIM_NO_NEPOMUK
     Nepomuk::Tag nepomukTag( label );
     nepomukTag.setLabel( name );
     nepomukTag.setSymbols( QStringList( iconName ) );
@@ -243,6 +245,7 @@ void KMailMigrator::migrateTags()
              << "shortcut=" << shortcut;
 
     newlyMigratedTags << groupName;
+#endif
   }
 
   if ( !newlyMigratedTags.isEmpty() ) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic