| 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 |
${MRUBY_INCLUDE_DIRS} |
| 19 |
${MESSAGE_PACK_INCLUDE_DIRS}) |
| 20 |
|
| 21 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/create_dataset_sources.am |
| 22 |
GROONGA_SUGGEST_CREATE_DATASET_SOURCES) |
| 23 |
add_executable(groonga-suggest-create-dataset |
| 24 |
${GROONGA_SUGGEST_CREATE_DATASET_SOURCES}) |
| 25 |
set_source_files_properties(${GROONGA_SUGGEST_CREATE_DATASET_SOURCES} |
| 26 |
PROPERTIES |
| 27 |
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 28 |
target_link_libraries(groonga-suggest-create-dataset libgroonga) |
| 29 |
install( |
| 30 |
TARGETS groonga-suggest-create-dataset |
| 31 |
DESTINATION ${BIN_DIR}) |
| 32 |
|
| 33 |
if(GRN_WITH_LIBEVENT AND GRN_WITH_ZEROMQ AND GRN_WITH_MESSAGE_PACK) |
| 34 |
set(GRN_WITH_SUGGEST_LEARNER TRUE) |
| 35 |
else() |
| 36 |
set(GRN_WITH_SUGGEST_LEARNER FALSE) |
| 37 |
endif() |
| 38 |
|
| 39 |
if(GRN_WITH_SUGGEST_LEARNER) |
| 40 |
include_directories( |
| 41 |
${LIBEVENT_INCLUDE_DIRS} |
| 42 |
${ZEROMQ_INCLUDE_DIRS} |
| 43 |
${MESSAGE_PACK_INCLUDE_DIRS} |
| 44 |
) |
| 45 |
link_directories( |
| 46 |
${LIBEVENT_LIBRARY_DIRS} |
| 47 |
${ZEROMQ_LIBRARY_DIRS} |
| 48 |
${MESSAGE_PACK_LIBRARY_DIRS} |
| 49 |
) |
| 50 |
|
| 51 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/util_sources.am |
| 52 |
GROONGA_SUGGEST_UTIL_SOURCES) |
| 53 |
add_library(groonga-suggest-util STATIC ${GROONGA_SUGGEST_UTIL_SOURCES}) |
| 54 |
set_source_files_properties(${GROONGA_SUGGEST_UTIL_SOURCES} |
| 55 |
PROPERTIES |
| 56 |
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 57 |
|
| 58 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/learner_sources.am |
| 59 |
GROONGA_SUGGEST_LEARNER_SOURCES) |
| 60 |
add_executable(groonga-suggest-learner ${GROONGA_SUGGEST_LEARNER_SOURCES}) |
| 61 |
set_source_files_properties(${GROONGA_SUGGEST_LEARNER_SOURCES} |
| 62 |
PROPERTIES |
| 63 |
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 64 |
target_link_libraries(groonga-suggest-learner |
| 65 |
groonga-suggest-util |
| 66 |
libgroonga |
| 67 |
${LIBEVENT_LIBRARIES} |
| 68 |
${ZEROMQ_LIBRARIES} |
| 69 |
${MESSAGE_PACK_LIBRARIES}) |
| 70 |
|
| 71 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/httpd_sources.am |
| 72 |
GROONGA_SUGGEST_HTTPD_SOURCES) |
| 73 |
add_executable(groonga-suggest-httpd ${GROONGA_SUGGEST_HTTPD_SOURCES}) |
| 74 |
set_source_files_properties(${GROONGA_SUGGEST_HTTPD_SOURCES} |
| 75 |
PROPERTIES |
| 76 |
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 77 |
target_link_libraries(groonga-suggest-httpd |
| 78 |
groonga-suggest-util |
| 79 |
libgroonga |
| 80 |
${LIBEVENT_LIBRARIES} |
| 81 |
${ZEROMQ_LIBRARIES} |
| 82 |
${MESSAGE_PACK_LIBRARIES}) |
| 83 |
|
| 84 |
install( |
| 85 |
TARGETS groonga-suggest-learner groonga-suggest-httpd |
| 86 |
DESTINATION ${BIN_DIR}) |
| 87 |
endif() |