| 1 |
# Copyright (C) 2012-2018 Brazil |
| 2 |
# Copyright (C) 2023-2024 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 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/create_dataset_sources.am |
| 19 |
GROONGA_SUGGEST_CREATE_DATASET_SOURCES) |
| 20 |
add_executable(groonga-suggest-create-dataset |
| 21 |
${GROONGA_SUGGEST_CREATE_DATASET_SOURCES}) |
| 22 |
set_source_files_properties(${GROONGA_SUGGEST_CREATE_DATASET_SOURCES} |
| 23 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 24 |
target_link_libraries(groonga-suggest-create-dataset libgroonga) |
| 25 |
install(TARGETS groonga-suggest-create-dataset |
| 26 |
DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 27 |
if(MSVC) |
| 28 |
install( |
| 29 |
FILES $<TARGET_PDB_FILE:groonga-suggest-create-dataset> |
| 30 |
DESTINATION "${CMAKE_INSTALL_BINDIR}" |
| 31 |
OPTIONAL) |
| 32 |
endif() |
| 33 |
|
| 34 |
if(GRN_WITH_LIBEVENT |
| 35 |
AND GRN_WITH_ZEROMQ |
| 36 |
AND GRN_WITH_MESSAGE_PACK) |
| 37 |
set(GRN_WITH_SUGGEST_LEARNER TRUE) |
| 38 |
else() |
| 39 |
set(GRN_WITH_SUGGEST_LEARNER FALSE) |
| 40 |
endif() |
| 41 |
|
| 42 |
if(GRN_WITH_SUGGEST_LEARNER) |
| 43 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/util_sources.am |
| 44 |
GROONGA_SUGGEST_UTIL_SOURCES) |
| 45 |
add_library(groonga-suggest-util STATIC ${GROONGA_SUGGEST_UTIL_SOURCES}) |
| 46 |
set_source_files_properties(${GROONGA_SUGGEST_UTIL_SOURCES} |
| 47 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 48 |
target_link_libraries(groonga-suggest-util libgroonga Groonga::libevent) |
| 49 |
|
| 50 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/learner_sources.am |
| 51 |
GROONGA_SUGGEST_LEARNER_SOURCES) |
| 52 |
add_executable(groonga-suggest-learner ${GROONGA_SUGGEST_LEARNER_SOURCES}) |
| 53 |
set_source_files_properties(${GROONGA_SUGGEST_LEARNER_SOURCES} |
| 54 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 55 |
target_link_libraries( |
| 56 |
groonga-suggest-learner |
| 57 |
groonga-suggest-util |
| 58 |
libgroonga |
| 59 |
Groonga::libevent |
| 60 |
Groonga::zeromq |
| 61 |
Groonga::msgpackc |
| 62 |
Threads::Threads) |
| 63 |
|
| 64 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/httpd_sources.am |
| 65 |
GROONGA_SUGGEST_HTTPD_SOURCES) |
| 66 |
add_executable(groonga-suggest-httpd ${GROONGA_SUGGEST_HTTPD_SOURCES}) |
| 67 |
set_source_files_properties(${GROONGA_SUGGEST_HTTPD_SOURCES} |
| 68 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 69 |
target_link_libraries( |
| 70 |
groonga-suggest-httpd |
| 71 |
groonga-suggest-util |
| 72 |
libgroonga |
| 73 |
Groonga::libevent |
| 74 |
Groonga::zeromq |
| 75 |
Groonga::msgpackc |
| 76 |
Threads::Threads) |
| 77 |
|
| 78 |
install(TARGETS groonga-suggest-learner groonga-suggest-httpd |
| 79 |
DESTINATION "${CMAKE_INSTALL_BINDIR}") |
| 80 |
if(MSVC) |
| 81 |
install( |
| 82 |
FILES $<TARGET_PDB_FILE:groonga-suggest-learner> |
| 83 |
$<TARGET_PDB_FILE:groonga-suggest-httpd> |
| 84 |
DESTINATION "${CMAKE_INSTALL_BINDIR}" |
| 85 |
OPTIONAL) |
| 86 |
endif() |
| 87 |
endif() |