Debian Codegraph @

plugins/token_filters/CMakeLists.txt

raw
1 # Copyright(C) 2014-2018 Brazil
2 # Copyright(C) 2023 Sutou Kouhei <[email protected]>
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18 set(TOKEN_FILTERS_DIR "${GRN_RELATIVE_PLUGINS_DIR}/token_filters")
19
20 read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/stop_word_sources.am
21 STOP_WORD_SOURCES)
22 set_source_files_properties(${STOP_WORD_SOURCES}
23 PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
24 if(GRN_EMBED)
25 add_library(stop_word_token_filter STATIC ${STOP_WORD_SOURCES})
26 set_target_properties(stop_word_token_filter
27 PROPERTIES POSITION_INDEPENDENT_CODE ON)
28 else()
29 add_library(stop_word_token_filter MODULE ${STOP_WORD_SOURCES})
30 set_target_properties(stop_word_token_filter PROPERTIES PREFIX "" OUTPUT_NAME
31 "stop_word")
32 install(TARGETS stop_word_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
33 if(MSVC)
34 install(
35 FILES $<TARGET_PDB_FILE:stop_word_token_filter>
36 DESTINATION "${TOKEN_FILTERS_DIR}"
37 OPTIONAL)
38 endif()
39 endif()
40 target_link_libraries(stop_word_token_filter libgroonga)
41
42 if(GRN_WITH_LIBSTEMMER)
43 read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/stem_sources.am STEM_SOURCES)
44 set_source_files_properties(${STEM_SOURCES}
45 PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
46 if(GRN_EMBED)
47 add_library(stem_token_filter STATIC ${STEM_SOURCES})
48 set_target_properties(stem_token_filter PROPERTIES POSITION_INDEPENDENT_CODE
49 ON)
50 else()
51 add_library(stem_token_filter MODULE ${STEM_SOURCES})
52 set_target_properties(stem_token_filter PROPERTIES PREFIX "" OUTPUT_NAME
53 "stem")
54 install(TARGETS stem_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
55 if(MSVC)
56 install(
57 FILES $<TARGET_PDB_FILE:stem_token_filter>
58 DESTINATION "${TOKEN_FILTERS_DIR}"
59 OPTIONAL)
60 endif()
61 endif()
62 target_link_libraries(stem_token_filter libgroonga Groonga::libstemmer)
63 endif()