Advertisement
AyratT

Untitled

Jul 3rd, 2023 (edited)
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.40 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.11)
  2.  
  3. project(TransportCatalogue LANGUAGES CXX)
  4. set(CMAKE_CXX_STANDARD 17)
  5.  
  6. find_package(Protobuf REQUIRED)
  7. find_package(Threads REQUIRED)
  8.  
  9. set (proto
  10.     "transport_catalogue.proto")
  11.  
  12. set (source_headers
  13.     "main.cpp"
  14.     "domain.cpp"
  15.     "geo.cpp"
  16.     "json.cpp"
  17.     "json_builder.cpp"
  18.     "json_reader.cpp"
  19.     "map_renderer.cpp"
  20.     "request_handler.cpp"
  21.     "serialization.cpp"
  22.     "svg.cpp"
  23.     "transport_catalogue.cpp"
  24.     "transport_router.cpp"
  25.     "domain.h"
  26.     "geo.h"
  27.     "graph.h"
  28.     "json.h"
  29.     "json_builder.h"
  30.     "json_reader.h"
  31.     "map_renderer.h"
  32.     "ranges.h"
  33.     "request_handler.h"
  34.     "router.h"
  35.     "serialization.h"
  36.     "svg.h"
  37.     "transport_catalogue.h"
  38.     "transport_router.h"
  39.    )
  40.  
  41. protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${proto})
  42.  
  43. add_executable(transport_catalogue ${source_headers} ${proto} ${PROTO_SRCS} ${PROTO_HDRS})
  44.  
  45. target_include_directories(transport_catalogue PUBLIC ${Protobuf_INCLUDE_DIRS})
  46. target_include_directories(transport_catalogue PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
  47.  
  48. string(REPLACE "protobuf.lib" "protobufd.lib" "Protobuf_LIBRARY_DEBUG" "${Protobuf_LIBRARY_DEBUG}")
  49. string(REPLACE "protobuf.a" "protobufd.a" "Protobuf_LIBRARY_DEBUG" "${Protobuf_LIBRARY_DEBUG}")
  50.  
  51. target_link_libraries(transport_catalogue "$<IF:$<CONFIG:Debug>,${Protobuf_LIBRARY_DEBUG},${Protobuf_LIBRARY}>" Threads::Threads)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement