summaryrefslogtreecommitdiff
path: root/storage/mroonga/vendor/groonga/src/suggest/CMakeLists.txt
blob: c0c7a9c9964debb04aab4ada7c307ce4a20b5cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright(C) 2012-2013 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
  ${MRUBY_INCLUDE_DIRS})

read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/create_dataset_sources.am
  GROONGA_SUGGEST_CREATE_DATASET_SOURCES)
add_executable(groonga-suggest-create-dataset
  ${GROONGA_SUGGEST_CREATE_DATASET_SOURCES})
set_source_files_properties(${GROONGA_SUGGEST_CREATE_DATASET_SOURCES}
  PROPERTIES
  COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
target_link_libraries(groonga-suggest-create-dataset libgroonga)
install(
  TARGETS groonga-suggest-create-dataset
  DESTINATION ${BIN_DIR})

if(GRN_WITH_LIBEVENT AND GRN_WITH_ZEROMQ AND GRN_WITH_MESSAGE_PACK)
  set(GRN_WITH_SUGGEST_LEARNER TRUE)
else()
  set(GRN_WITH_SUGGEST_LEARNER FALSE)
endif()

if(GRN_WITH_SUGGEST_LEARNER)
  include_directories(
    ${LIBEVENT_INCLUDE_DIRS}
    ${ZEROMQ_INCLUDE_DIRS}
    ${MESSAGE_PACK_INCLUDE_DIRS}
    )
  link_directories(
    ${LIBEVENT_LIBRARY_DIRS}
    ${ZEROMQ_LIBRARY_DIRS}
    ${MESSAGE_PACK_LIBRARY_DIRS}
    )

  read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/util_sources.am
    GROONGA_SUGGEST_UTIL_SOURCES)
  add_library(groonga-suggest-util STATIC ${GROONGA_SUGGEST_UTIL_SOURCES})
  set_source_files_properties(${GROONGA_SUGGEST_UTIL_SOURCES}
    PROPERTIES
    COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")

  read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/learner_sources.am
    GROONGA_SUGGEST_LEARNER_SOURCES)
  add_executable(groonga-suggest-learner ${GROONGA_SUGGEST_LEARNER_SOURCES})
  set_source_files_properties(${GROONGA_SUGGEST_LEARNER_SOURCES}
    PROPERTIES
    COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
  target_link_libraries(groonga-suggest-learner
    groonga-suggest-util
    libgroonga
    ${LIBEVENT_LIBRARIES}
    ${ZEROMQ_LIBRARIES}
    ${MESSAGE_PACK_LIBRARIES})

  read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/httpd_sources.am
    GROONGA_SUGGEST_HTTPD_SOURCES)
  add_executable(groonga-suggest-httpd ${GROONGA_SUGGEST_HTTPD_SOURCES})
  set_source_files_properties(${GROONGA_SUGGEST_HTTPD_SOURCES}
    PROPERTIES
    COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
  target_link_libraries(groonga-suggest-httpd
    groonga-suggest-util
    libgroonga
    ${LIBEVENT_LIBRARIES}
    ${ZEROMQ_LIBRARIES}
    ${MESSAGE_PACK_LIBRARIES})

  install(
    TARGETS groonga-suggest-learner groonga-suggest-httpd
    DESTINATION ${BIN_DIR})
endif()