project(search)

set(SRC
  algos.hpp
  approximate_string_match.cpp
  approximate_string_match.hpp
  base/inverted_list.hpp
  base/mem_search_index.hpp
  base/text_index/dictionary.hpp
  base/text_index/header.cpp
  base/text_index/header.hpp
  base/text_index/mem.cpp
  base/text_index/mem.hpp
  base/text_index/merger.cpp
  base/text_index/merger.hpp
  base/text_index/postings.hpp
  base/text_index/reader.hpp
  base/text_index/text_index.cpp
  base/text_index/text_index.hpp
  base/text_index/utils.hpp
  bookmarks/data.cpp
  bookmarks/data.hpp
  bookmarks/processor.cpp
  bookmarks/processor.hpp
  bookmarks/results.hpp
  bookmarks/types.cpp
  bookmarks/types.hpp
  cancel_exception.hpp
  categories_cache.cpp
  categories_cache.hpp
  categories_set.hpp
  cbv.cpp
  cbv.hpp
  cities_boundaries_table.cpp
  cities_boundaries_table.hpp
  city_finder.cpp
  city_finder.hpp
  common.hpp
  cuisine_filter.cpp
  cuisine_filter.hpp
  displayed_categories.cpp
  displayed_categories.hpp
  doc_vec.cpp
  doc_vec.hpp
  downloader_search_callback.cpp
  downloader_search_callback.hpp
  dummy_rank_table.cpp
  dummy_rank_table.hpp
  editor_delegate.cpp
  editor_delegate.hpp
  emitter.hpp
  engine.cpp
  engine.hpp
  feature_loader.cpp
  feature_loader.hpp
  feature_offset_match.hpp
  features_filter.cpp
  features_filter.hpp
  features_layer.cpp
  features_layer.hpp
  features_layer_matcher.cpp
  features_layer_matcher.hpp
  # Template functions implementation. Should be included when using.
  # features_layer_path_finder.cpp
  features_layer_path_finder.hpp
  filtering_params.hpp
  geocoder.cpp
  geocoder.hpp
  geocoder_context.cpp
  geocoder_context.hpp
  geocoder_locality.cpp
  geocoder_locality.hpp
  geometry_cache.cpp
  geometry_cache.hpp
  geometry_utils.cpp
  geometry_utils.hpp
  highlighting.cpp
  highlighting.hpp
  house_detector.cpp
  house_detector.hpp
  house_numbers_matcher.cpp
  house_numbers_matcher.hpp
  house_to_street_table.cpp
  house_to_street_table.hpp
  idf_map.cpp
  idf_map.hpp
  intermediate_result.cpp
  intermediate_result.hpp
  intersection_result.cpp
  intersection_result.hpp
  interval_set.hpp
  keyword_lang_matcher.cpp
  keyword_lang_matcher.hpp
  keyword_matcher.cpp
  keyword_matcher.hpp
  latlon_match.cpp
  latlon_match.hpp
  lazy_centers_table.cpp
  lazy_centers_table.hpp
  localities_source.cpp
  localities_source.hpp
  locality_finder.cpp
  locality_finder.hpp
  locality_scorer.cpp
  locality_scorer.hpp
  mode.cpp
  mode.hpp
  model.cpp
  model.hpp
  mwm_context.cpp
  mwm_context.hpp
  nested_rects_cache.cpp
  nested_rects_cache.hpp
  point_rect_matcher.hpp
  postcode_points.cpp
  postcode_points.hpp
  pre_ranker.cpp
  pre_ranker.hpp
  pre_ranking_info.cpp
  pre_ranking_info.hpp
  processor.cpp
  processor.hpp
  projection_on_street.cpp
  projection_on_street.hpp
  query_params.cpp
  query_params.hpp
  query_saver.cpp
  query_saver.hpp
  ranker.cpp
  ranker.hpp
  ranking_info.cpp
  ranking_info.hpp
  ranking_utils.cpp
  ranking_utils.hpp
  region_address_getter.cpp
  region_address_getter.hpp
  region_info_getter.cpp
  region_info_getter.hpp
  result.cpp
  result.hpp
  retrieval.cpp
  retrieval.hpp
  reverse_geocoder.cpp
  reverse_geocoder.hpp
  search_index_values.hpp
  search_params.cpp
  search_params.hpp
  search_trie.hpp
  segment_tree.cpp
  segment_tree.hpp
  stats_cache.hpp
  street_vicinity_loader.cpp
  street_vicinity_loader.hpp
  streets_matcher.cpp
  streets_matcher.hpp
  string_utils.cpp
  string_utils.hpp
  suggest.cpp
  suggest.hpp
  token_range.hpp
  token_slice.cpp
  token_slice.hpp
  tracer.cpp
  tracer.hpp
  types_skipper.cpp
  types_skipper.hpp
  utils.cpp
  utils.hpp
  utm_mgrs_coords_match.cpp
  utm_mgrs_coords_match.hpp
)

omim_add_library(${PROJECT_NAME} ${SRC})

target_link_libraries(${PROJECT_NAME}
  PUBLIC
    editor
    storage
    ge0
    openlocationcode
)

if(PLATFORM_DESKTOP)
  add_subdirectory(search_tests_support)
  add_subdirectory(search_quality)
endif()

omim_add_test_subdirectory(search_tests)
omim_add_test_subdirectory(search_integration_tests)
