| 1 |
# Copyright (C) 2012-2018 Brazil |
| 2 |
# Copyright (C) 2022-2025 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 |
add_subdirectory(suggest) |
| 19 |
|
| 20 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/groonga_sources.am GROONGA_SOURCES) |
| 21 |
add_executable(groonga ${GROONGA_SOURCES}) |
| 22 |
set_source_files_properties(${GROONGA_SOURCES} |
| 23 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 24 |
target_link_libraries(groonga libgroonga) |
| 25 |
if(NOT WASI) |
| 26 |
target_link_libraries(groonga Threads::Threads) |
| 27 |
endif() |
| 28 |
if(GRN_WITH_LIBEDIT) |
| 29 |
target_link_libraries(groonga Groonga::libedit) |
| 30 |
endif() |
| 31 |
if(WIN32) |
| 32 |
target_link_libraries(groonga ws2_32.lib) |
| 33 |
endif() |
| 34 |
install(TARGETS groonga DESTINATION ${BINDIR}) |
| 35 |
if(MSVC) |
| 36 |
install( |
| 37 |
FILES $<TARGET_PDB_FILE:groonga> |
| 38 |
DESTINATION "${CMAKE_INSTALL_BINDIR}" |
| 39 |
OPTIONAL) |
| 40 |
endif() |
| 41 |
|
| 42 |
if(GRN_WITH_MRUBY) |
| 43 |
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/grndb_sources.am GRNDB_SOURCES) |
| 44 |
add_executable(grndb ${GRNDB_SOURCES}) |
| 45 |
set_source_files_properties(${GRNDB_SOURCES} |
| 46 |
PROPERTIES COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}") |
| 47 |
set_source_files_properties( |
| 48 |
${GRNDB_SOURCES} PROPERTIES COMPILE_DEFINITIONS "${MRUBY_DEFINITIONS}") |
| 49 |
target_link_libraries(grndb libgroonga mruby) |
| 50 |
install(TARGETS grndb DESTINATION ${BINDIR}) |
| 51 |
if(MSVC) |
| 52 |
install( |
| 53 |
FILES $<TARGET_PDB_FILE:grndb> |
| 54 |
DESTINATION "${CMAKE_INSTALL_BINDIR}" |
| 55 |
OPTIONAL) |
| 56 |
endif() |
| 57 |
endif() |