Advertisement
cpphater__

Untitled

Jun 28th, 2023
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.43 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.18)
  2.  
  3. project(transport_catalogue CXX)
  4. set(CMAKE_CXX_STANDARD 17)
  5.  
  6. find_package(Protobuf REQUIRED)
  7. find_package(Threads REQUIRED)
  8.  
  9. protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS transport_catalogue.proto)
  10.  
  11. set(TRANSCAT_FILES domain.h
  12.         geo.h
  13.         graph.h
  14.         json.cpp json.h
  15.         json_builder.cpp json_builder.h
  16.         json_reader.cpp json_reader.h
  17.         main.cpp
  18.         map_renderer.cpp map_renderer.h
  19.         ranges.h
  20.         request_handler.cpp request_handler.h
  21.         router.h
  22.         serialization.h serialization.cpp
  23.         svg.cpp svg.h
  24.         transport_catalogue.cpp transport_catalogue.h transport_catalogue.proto
  25.         transport_router.cpp transport_router.h
  26.         ${PROTO_SRCS} ${PROTO_HDRS})
  27.  
  28. add_executable(transport_catalogue ${PROTO_SRCS} ${PROTO_HDRS} ${TRANSCAT_FILES})
  29. target_include_directories(transport_catalogue PUBLIC ${Protobuf_INCLUDE_DIRS})
  30. target_include_directories(transport_catalogue PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
  31.  
  32. set_target_properties(transport_catalogue PROPERTIES OUTPUT_NAME "transport_catalogue")
  33.  
  34.  
  35. string(REPLACE "protobuf.lib" "protobufd.lib" "Protobuf_LIBRARY_DEBUG" "${Protobuf_LIBRARY_DEBUG}")
  36. string(REPLACE "protobuf.a" "protobufd.a" "Protobuf_LIBRARY_DEBUG" "${Protobuf_LIBRARY_DEBUG}")
  37.  
  38. target_link_libraries(transport_catalogue "$<IF:$<CONFIG:Debug>,${Protobuf_LIBRARY_DEBUG},${Protobuf_LIBRARY}>" Threads::Threads)
Tags: cmake
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement