From 7fb3ef7d2e49e8d4928d66349b55154e4df03678 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 31 Jul 2012 13:56:30 +0800 Subject: fixes cmake --- CMakeLists.txt | 8 ++++---- data/CMakeLists.txt | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fc0cc0..1cd357e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,9 +24,9 @@ enable_testing() set (PACKAGE_URL https://github.com/libpinyin/libpinyin) set (PACKAGE_BUGREPORT https://github.com/libpinyin/libpinyin/issues) set (LIBPINYIN_VERSION_MAJOR 0) -set (LIBPINYIN_VERSION_MINOR 2) -set (LIBPINYIN_VERSION_REVISION 99) -set (LIBPINYIN_BINARY_VERSION 0.3) +set (LIBPINYIN_VERSION_MINOR 7) +set (LIBPINYIN_VERSION_REVISION 0) +set (LIBPINYIN_BINARY_VERSION 2.0) if (CMAKE_BUILD_TYPE MATCHES Debug) set (version_suffix .Debug) @@ -137,7 +137,7 @@ include_directories( ######## Subdirectories -add_subdirectory(data) add_subdirectory(src) add_subdirectory(tests) add_subdirectory(utils) +add_subdirectory(data) diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 90375e6..467f226 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -33,6 +33,19 @@ add_custom_target( ${BINARY_MODEL_DATA} ) +add_custom_command( + OUTPUT + ${CMAKE_SOURCE_DIR}/data/gb_char.table + ${CMAKE_SOURCE_DIR}/data/gbk_char.table + ${CMAKE_SOURCE_DIR}/data/interpolation.text + COMMENT + "Downloading textual model data..." + COMMAND + wget https://github.com/downloads/libpinyin/libpinyin/model.text.tar.gz + COMMAND + tar xvf model.text.tar.gz -C ${CMAKE_SOURCE_DIR}/data +) + add_custom_command( OUTPUT gb_char.bin @@ -45,6 +58,8 @@ add_custom_command( ${gen_binary_files_BIN} --table-dir ${CMAKE_SOURCE_DIR}/data DEPENDS gen_binary_files + ${CMAKE_SOURCE_DIR}/data/gb_char.table + ${CMAKE_SOURCE_DIR}/data/gbk_char.table ) add_custom_command( @@ -56,6 +71,7 @@ add_custom_command( ${import_interpolation_BIN} < ${CMAKE_SOURCE_DIR}/data/interpolation.text DEPENDS import_interpolation + ${CMAKE_SOURCE_DIR}/data/interpolation.text ) install( @@ -69,4 +85,4 @@ set_directory_properties( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${BINARY_MODEL_DATA_FILES} -) \ No newline at end of file +) -- cgit