Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.20)
- project(gRPC)
- set(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc-8")
- set(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++-8")
- set(CMAKE_VERBOSE_MAKEFILE ON)
- set(CMAKE_SKIP_BUILD_RPATH FALSE)
- set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
- # the RPATH to be used when installing
- set(CMAKE_INSTALL_RPATH "lib/")
- # don't add the automatically determined parts of the RPATH
- # which point to directories outside the build tree to the install RPATH
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
- add_executable(client)
- add_executable(server)
- target_sources(client
- PRIVATE
- greeter_client.cc
- helloworld.grpc.pb.cc
- helloworld.pb.cc
- )
- target_sources(server
- PRIVATE
- greeter_server.cc
- helloworld.grpc.pb.cc
- helloworld.pb.cc
- )
- target_include_directories(client
- PRIVATE
- ArmLibs/grpcInstall/platform/ARM/include
- ArmLibs/grpc/third_party/abseil-cpp
- )
- target_include_directories(server
- PRIVATE
- ArmLibs/grpcInstall/platform/ARM/include
- ArmLibs/grpc/third_party/abseil-cpp
- )
- target_link_directories(client
- PRIVATE
- ArmLibs/grpcInstall/platform/ARM/lib
- )
- target_link_directories(server
- PRIVATE
- ArmLibs/grpcInstall/platform/ARM/lib
- )
- target_link_libraries(client
- PRIVATE
- -lprotobuf
- -lgrpc++
- -lgrpc++_reflection
- )
- target_link_libraries(server
- PRIVATE
- -lprotobuf
- -lgrpc++
- -lgrpc++_reflection
- )
- install(
- TARGETS client server
- RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/build/install
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement