summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--ConfigureChecks.cmake18
-rw-r--r--indexlib/CMakeLists.txt56
-rw-r--r--indexlib/ConfigureChecks.cmake24
-rw-r--r--indexlib/indexlib-config.in8
-rw-r--r--kmail/CMakeLists.txt8
-rw-r--r--kmail/ConfigureChecks.cmake23
7 files changed, 111 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f88f632cd..2d2ee8d0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,7 @@ option( WITH_NEWEXCHANGE "Enable newexchange support" OFF )
option( WITH_SCALIX "Enable scalix support" OFF )
option( WITH_CALDAV "Enable caldav support" OFF )
option( WITH_CARDDAV "Enable carddav support" OFF )
+option( WITH_INDEXLIB "Enable indexlib support (in kmail)" OFF )
if( NOT WITH_ARTS )
set( WITHOUT_ARTS 1 )
@@ -72,6 +73,7 @@ endif( )
##### user requested modules ####################
option( BUILD_ALL "Build all" OFF )
+option( BUILD_INDEXLIB "Build indexlib" ${BUILD_ALL} )
option( BUILD_LIBKMIME "Build libkmime" ${BUILD_ALL} )
option( BUILD_KTNEF "Build ktnef" ${BUILD_ALL} )
option( BUILD_LIBKCAL "Build libkcal" ${BUILD_ALL} )
@@ -136,6 +138,7 @@ endif()
##### kdepim directories ########################
+tde_conditional_add_subdirectory( BUILD_INDEXLIB indexlib )
tde_conditional_add_subdirectory( BUILD_LIBKMIME libkmime )
tde_conditional_add_subdirectory( BUILD_KTNEF ktnef )
tde_conditional_add_subdirectory( BUILD_LIBKCAL libkcal )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index a51178baa..13dfa5327 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -14,6 +14,24 @@ if( BUILD_LIBKDEPIM OR BUILD_KMAIL )
endif( )
+if( BUILD_INDEXLIB OR BUILD_KMAIL )
+
+ # check for stl coping with namespace std
+ tde_save( CMAKE_CXX_FLAGS )
+ string( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
+ check_cxx_source_compiles("
+ #include <iterator>
+ struct s : public std::iterator<std::forward_iterator_tag, int> {};
+ int main(int, char**) { return 0; } "
+ HAVE_STLNAMESPACE )
+ tde_restore( CMAKE_CXX_FLAGS )
+ if( HAVE_STLNAMESPACE )
+ set( STD_NAMESPACE_PREFIX "std::" )
+ endif( )
+
+endif( )
+
+
if( BUILD_LIBKDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOOK )
if( NOT HAVE_GPGME_0_4_BRANCH )
diff --git a/indexlib/CMakeLists.txt b/indexlib/CMakeLists.txt
new file mode 100644
index 000000000..bb8646605
--- /dev/null
+++ b/indexlib/CMakeLists.txt
@@ -0,0 +1,56 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+project( indexlib )
+
+include( ConfigureChecks.cmake )
+
+string( REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
+set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include compat.h ${USE_EXCEPTIONS}" )
+
+include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_BINARY_DIR}
+)
+
+
+##### headers ###################################
+
+install( FILES
+ create.h index.h lockfile.h
+ DESTINATION ${INCLUDE_INSTALL_DIR}/index )
+
+
+##### other data ################################
+
+configure_file( indexlib-config.in indexlib-config @ONLY )
+
+install( PROGRAMS
+ ${CMAKE_CURRENT_BINARY_DIR}/indexlib-config
+ DESTINATION ${BIN_INSTALL_DIR} )
+
+
+##### index (shared) ############################
+
+tde_add_library( index SHARED
+ SOURCES
+ bitstream.cpp compressed.cpp create.cpp exception.cpp ifile.cpp
+ leafdata.cpp leafdatavector.cpp lockfile.cpp logfile.cpp match.cpp
+ mmap_manager.cpp quotes.cpp slow.cpp stringarray.cpp stringset.cpp
+ tokenizer.cpp
+ LINK z
+ DESTINATION ${LIB_INSTALL_DIR}
+)
+
+
+##### install import cmake modules ###############
+
+tde_install_export( )
diff --git a/indexlib/ConfigureChecks.cmake b/indexlib/ConfigureChecks.cmake
new file mode 100644
index 000000000..77664377f
--- /dev/null
+++ b/indexlib/ConfigureChecks.cmake
@@ -0,0 +1,24 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include( CheckIncludeFileCXX )
+
+tde_save( CMAKE_CXX_FLAGS CMAKE_REQUIRED_INCLUDES )
+unset( CMAKE_CXX_FLAGS )
+set( CMAKE_REQUIRED_INCLUDES ${BOOST_INCLUDE_DIR} )
+
+check_include_file_cxx( "boost/format.hpp" HAVE_BOOST )
+
+if( NOT HAVE_BOOST )
+ tde_message_fatal( "boost library is required, but was not found on your system.\n Try to set boost include dir to BOOST_INCLUDE_DIR." )
+endif( )
+
+tde_restore( CMAKE_CXX_FLAGS CMAKE_REQUIRED_INCLUDES )
diff --git a/indexlib/indexlib-config.in b/indexlib/indexlib-config.in
index f478bad4c..5462c8a81 100644
--- a/indexlib/indexlib-config.in
+++ b/indexlib/indexlib-config.in
@@ -13,10 +13,10 @@ options:
EOH
}
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@EXEC_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
flags=""
diff --git a/kmail/CMakeLists.txt b/kmail/CMakeLists.txt
index a9a198a6a..21ba5e16f 100644
--- a/kmail/CMakeLists.txt
+++ b/kmail/CMakeLists.txt
@@ -11,7 +11,11 @@
project( kmail )
-include( ConfigureChecks.cmake )
+if( WITH_INDEXLIB )
+ tde_import( indexlib )
+ add_definitions( -DHAVE_INDEXLIB )
+ set( INDEX_LIBRARY index-shared )
+endif( )
tde_import( libkdenetwork )
tde_import( certmanager )
@@ -187,7 +191,7 @@ tde_add_library( ${target} SHARED AUTOMOC
SOURCES ${${target}_SRCS}
LINK
emailfunctions-static kmime-shared kpgp-shared kdepim-shared kpimidentities-shared
- mimelib-shared ksieve-shared khtml-shared
+ mimelib-shared ksieve-shared khtml-shared ${INDEX_LIBRARY}
DESTINATION ${LIB_INSTALL_DIR}
)
diff --git a/kmail/ConfigureChecks.cmake b/kmail/ConfigureChecks.cmake
deleted file mode 100644
index dbda06e3f..000000000
--- a/kmail/ConfigureChecks.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-#################################################
-#
-# (C) 2010-2011 Serghei Amelian
-# serghei (DOT) amelian (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
-
-# check for stl coping with namespace std
-tde_save( CMAKE_CXX_FLAGS )
-string( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
-check_cxx_source_compiles("
- #include <iterator>
- struct s : public std::iterator<std::forward_iterator_tag, int> {};
- int main(int, char**) { return 0; } "
- HAVE_STLNAMESPACE )
-tde_restore( CMAKE_CXX_FLAGS )
-if( HAVE_STLNAMESPACE )
- set( STD_NAMESPACE_PREFIX "std::" CACHE INTERNAL "" FORCE )
-endif( )