From c47a095c10f6104fefb7d0406b7f4076ed47f16c Mon Sep 17 00:00:00 2001 From: BYVoid Date: Thu, 11 Aug 2011 18:19:08 +0800 Subject: Add cmake scripts. --- src/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++ src/include/CMakeLists.txt | 13 ++++++++++++ src/lookup/CMakeLists.txt | 27 +++++++++++++++++++++++++ src/storage/CMakeLists.txt | 42 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/include/CMakeLists.txt create mode 100644 src/lookup/CMakeLists.txt create mode 100644 src/storage/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..7fa83af --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,50 @@ +set( + LIBPINYIN_HEADERS + pinyin.h +) + +set( + LIBPINYIN_SOURCES + pinyin.cpp +) + +add_library( + libpinyin + SHARED + ${LIBPINYIN_SOURCES} +) + +target_link_libraries( + libpinyin + libstorage + liblookup +) + +set_target_properties( + libpinyin + PROPERTIES + OUTPUT_NAME + pinyin + VERSION + 0.0.0 + SOVERSION + 0 +) + +install( + TARGETS + libpinyin + LIBRARY DESTINATION + ${DIR_LIBRARY} +) + +install( + FILES + ${LIBPINYIN_HEADERS} + DESTINATION + ${DIR_INCLUDE_LIBPINYIN} +) + +add_subdirectory(include) +add_subdirectory(storage) +add_subdirectory(lookup) \ No newline at end of file diff --git a/src/include/CMakeLists.txt b/src/include/CMakeLists.txt new file mode 100644 index 0000000..79da024 --- /dev/null +++ b/src/include/CMakeLists.txt @@ -0,0 +1,13 @@ +set( + LIBPINYIN_INCLUDE_HEADERS + memory_chunk.h + novel_types.h + stl_lite.h +) + +install( + FILES + ${LIBPINYIN_INCLUDE_HEADERS} + DESTINATION + ${DIR_INCLUDE_LIBPINYIN} +) diff --git a/src/lookup/CMakeLists.txt b/src/lookup/CMakeLists.txt new file mode 100644 index 0000000..99edbb6 --- /dev/null +++ b/src/lookup/CMakeLists.txt @@ -0,0 +1,27 @@ +set( + LIBLOOKUP_HEADERS + lookup.h + pinyin_lookup.h + phrase_lookup.h + winner_tree.h +) + +set( + LIBLOOKUP_SOURCES + pinyin_lookup.cpp + winner_tree.cpp + phrase_lookup.cpp +) + +add_library( + liblookup + STATIC + ${LIBLOOKUP_SOURCES} +) + +install( + FILES + ${LIBLOOKUP_HEADERS} + DESTINATION + ${DIR_INCLUDE_LIBPINYIN} +) diff --git a/src/storage/CMakeLists.txt b/src/storage/CMakeLists.txt new file mode 100644 index 0000000..55601b5 --- /dev/null +++ b/src/storage/CMakeLists.txt @@ -0,0 +1,42 @@ +set( + LIBSTORAGE_HEADERS + pinyin_large_table.h + pinyin_base.h + pinyin_phrase.h + phrase_index.h + phrase_index_logger.h + pinyin_zhuyin_map_data.h + phrase_large_table.h + ngram.h + flexible_ngram.h + tag_utility.h +) + +set( + LIBSTORAGE_SOURCES + pinyin_base.cpp + pinyin_large_table.cpp + phrase_index.cpp + phrase_large_table.cpp + ngram.cpp + tag_utility.cpp +) + +add_library( + libstorage + STATIC + ${LIBSTORAGE_SOURCES} +) + +target_link_libraries( + libstorage + ${GLIB2_LIBRARIES} + ${BERKELEY_DB_LIBRARIES} +) + +install( + FILES + ${LIBSTORAGE_HEADERS} + DESTINATION + ${DIR_INCLUDE_LIBPINYIN} +) -- cgit