| 1 |
# Copyright(C) 2012-2013 Brazil |
| 2 |
# |
| 3 |
# This library is free software; you can redistribute it and/or |
| 4 |
# modify it under the terms of the GNU Lesser General Public |
| 5 |
# License version 2.1 as published by the Free Software Foundation. |
| 6 |
# |
| 7 |
# This library is distributed in the hope that it will be useful, |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 10 |
# Lesser General Public License for more details. |
| 11 |
# |
| 12 |
# You should have received a copy of the GNU Lesser General Public |
| 13 |
# License along with this library; if not, write to the Free Software |
| 14 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA |
| 15 |
|
| 16 |
include_directories( |
| 17 |
${CMAKE_CURRENT_SOURCE_DIR}/../../lib |
| 18 |
) |
| 19 |
|
| 20 |
set(TOKENIZERS_DIR "${GRN_RELATIVE_PLUGINS_DIR}/tokenizers") |
| 21 |
if(GRN_WITH_MECAB) |
| 22 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/mecab_sources.am MECAB_SOURCES) |
| 23 |
include_directories(${MECAB_INCLUDE_DIRS}) |
| 24 |
link_directories(${MECAB_LIBRARY_DIRS}) |
| 25 |
if(GRN_WITH_BUNDLED_MECAB) |
| 26 |
set(GRN_BUNDLED_MECAB_RELATIVE_RC_PATH "${CONFIG_DIR}/mecabrc") |
| 27 |
set(MECAB_COMPILE_DEFINITIONS |
| 28 |
"GRN_WITH_BUNDLED_MECAB" |
| 29 |
"GRN_BUNDLED_MECAB_RELATIVE_RC_PATH=\"${GRN_BUNDLED_MECAB_RELATIVE_RC_PATH}\"" |
| 30 |
"GRN_BUNDLED_MECAB_RC_PATH=\"${CMAKE_INSTALL_PREFIX}/${GRN_BUNDLED_MECAB_RELATIVE_RC_PATH}\"") |
| 31 |
set_source_files_properties(${MECAB_SOURCES} |
| 32 |
PROPERTIES |
| 33 |
COMPILE_DEFINITIONS |
| 34 |
"${MECAB_COMPILE_DEFINITIONS}") |
| 35 |
endif() |
| 36 |
set_source_files_properties(${MECAB_SOURCES} |
| 37 |
PROPERTIES |
| 38 |
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 39 |
if(GRN_EMBED) |
| 40 |
add_library(mecab_tokenizer STATIC ${MECAB_SOURCES}) |
| 41 |
set_target_properties( |
| 42 |
mecab_tokenizer |
| 43 |
PROPERTIES |
| 44 |
POSITION_INDEPENDENT_CODE ON) |
| 45 |
else() |
| 46 |
add_library(mecab_tokenizer MODULE ${MECAB_SOURCES}) |
| 47 |
set_target_properties(mecab_tokenizer PROPERTIES |
| 48 |
PREFIX "" |
| 49 |
OUTPUT_NAME "mecab") |
| 50 |
install(TARGETS mecab_tokenizer DESTINATION "${TOKENIZERS_DIR}") |
| 51 |
endif() |
| 52 |
target_link_libraries(mecab_tokenizer libgroonga ${MECAB_LIBRARIES}) |
| 53 |
endif() |
| 54 |
|
| 55 |
if(GRN_WITH_KYTEA) |
| 56 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/kytea_sources.am KYTEA_SOURCES) |
| 57 |
include_directories(${KYTEA_INCLUDE_DIRS}) |
| 58 |
link_directories(${KYTEA_LIBRARY_DIRS}) |
| 59 |
set_source_files_properties(${KYTEA_SOURCES} |
| 60 |
PROPERTIES |
| 61 |
COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS}") |
| 62 |
if(GRN_EMBED) |
| 63 |
add_library(kytea_tokenizer STATIC ${KYTEA_SOURCES}) |
| 64 |
set_target_properties( |
| 65 |
kytea_tokenizer |
| 66 |
PROPERTIES |
| 67 |
POSITION_INDEPENDENT_CODE ON) |
| 68 |
else() |
| 69 |
add_library(kytea_tokenizer MODULE ${KYTEA_SOURCES}) |
| 70 |
set_target_properties(kytea_tokenizer PROPERTIES |
| 71 |
PREFIX "" |
| 72 |
OUTPUT_NAME "kytea") |
| 73 |
install(TARGETS kytea_tokenizer DESTINATION "${TOKENIZERS_DIR}") |
| 74 |
endif() |
| 75 |
target_link_libraries(kytea_tokenizer libgroonga ${KYTEA_LIBRARIES}) |
| 76 |
endif() |