Advertisement
Guest User

Untitled

a guest
Jan 9th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.63 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.20)
  2.  
  3. project(gRPC)
  4.  
  5. set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc-8")
  6. set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++-8")
  7.  
  8. set(CMAKE_VERBOSE_MAKEFILE ON)
  9.  
  10. set(CMAKE_SKIP_BUILD_RPATH FALSE)
  11.  
  12. set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
  13.  
  14. # the RPATH to be used when installing
  15. set(CMAKE_INSTALL_RPATH "lib/")
  16.  
  17. # don't add the automatically determined parts of the RPATH
  18. # which point to directories outside the build tree to the install RPATH
  19. set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  20.  
  21. add_executable(client)
  22. add_executable(server)
  23.  
  24. target_sources(client
  25.     PRIVATE
  26.         greeter_client.cc
  27.         helloworld.grpc.pb.cc
  28.         helloworld.pb.cc
  29. )
  30.  
  31. target_sources(server
  32.     PRIVATE
  33.         greeter_server.cc
  34.         helloworld.grpc.pb.cc
  35.         helloworld.pb.cc
  36. )
  37.  
  38. target_include_directories(client
  39.     PRIVATE
  40.         ArmLibs/grpcInstall/platform/ARM/include
  41.         ArmLibs/grpc/third_party/abseil-cpp
  42. )
  43.  
  44. target_include_directories(server
  45.     PRIVATE
  46.         ArmLibs/grpcInstall/platform/ARM/include
  47.         ArmLibs/grpc/third_party/abseil-cpp
  48. )
  49.  
  50. target_link_directories(client
  51.     PRIVATE
  52.         ArmLibs/grpcInstall/platform/ARM/lib
  53. )
  54.  
  55. target_link_directories(server
  56.     PRIVATE
  57.         ArmLibs/grpcInstall/platform/ARM/lib
  58. )
  59.  
  60. target_link_libraries(client
  61.     PRIVATE
  62.         -lprotobuf
  63.         -lgrpc++
  64.         -lgrpc++_reflection
  65. )
  66.  
  67. target_link_libraries(server
  68.     PRIVATE
  69.         -lprotobuf
  70.         -lgrpc++
  71.         -lgrpc++_reflection
  72. )
  73.  
  74. install(
  75.     TARGETS client server
  76.     RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/build/install
  77. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement