summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09421f6..5c49d2f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,13 +58,30 @@ check_function_exists(memset HAVE_MEMSET)
check_function_exists(realloc HAVE_REALLOC)
check_function_exists(setlocale HAVE_SETLOCALE)
check_function_exists(stat HAVE_STAT)
+check_function_exists(mmap HAVE_MMAP)
include(CheckTypeSize)
check_type_size(size_t SIZE_OF_SIZE_T)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(GLIB2 REQUIRED)
-find_package(BerkeleyDB REQUIRED)
+
+# DBM: BerkeleyDB
+find_package(BerkeleyDB)
+if (DB_FOUND)
+ include_directories ( ${DB_INCLUDE_DIR} )
+ SET (LIBS ${LIBS} ${DB_LIBRARIES})
+ SET (HAVE_BERKELEY_DB 1)
+endif (DB_FOUND)
+
+# DBM: Kyoto Cabinet
+find_package(KyotoCabinet)
+if (KyotoCabinet_FOUND)
+ include_directories ( ${KyotoCabinet_INCLUDE_PATH} )
+ SET (LIBS ${LIBS} ${KyotoCabinet_LIBRARY})
+ SET (HAVE_KYOTO_CABINET 1)
+endif (KyotoCabinet_FOUND)
+
######## Windows
@@ -117,6 +134,12 @@ configure_file(
@ONLY
)
+configure_file(
+ config.h.cmake
+ config.h
+ @ONLY
+)
+
install(
FILES
${CMAKE_BINARY_DIR}/libpinyin.pc