Compare commits
2 Commits
5edf51e25c
...
7aff4a94b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 7aff4a94b6 | |||
| 9967d184e0 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ build/
|
||||
compile_commands.json
|
||||
.cache
|
||||
.qtcreator
|
||||
vcpkg_installed
|
||||
|
||||
@@ -16,7 +16,20 @@
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.10.2/gcc_64/lib/cmake"
|
||||
"CMAKE_MAKE_PROGRAM": {
|
||||
"type": "FILEPATH",
|
||||
"value": "/usr/bin/ninja"
|
||||
},
|
||||
"CMAKE_CXX_COMPILER": {
|
||||
"type": "FILEPATH",
|
||||
"value": "/usr/bin/g++"
|
||||
},
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.10.2/gcc_64/lib/cmake",
|
||||
"VCPKG_TARGET_TRIPLET": "x64-linux",
|
||||
"VCPKG_MANIFEST_MODE": "ON",
|
||||
"VCPKG_MANIFEST_DIR": "${sourceDir}",
|
||||
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkg_installed"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -5,8 +5,23 @@ project(proto LANGUAGES CXX)
|
||||
find_package(protobuf CONFIG REQUIRED)
|
||||
find_package(gRPC CONFIG REQUIRED)
|
||||
|
||||
find_program(PROTOC_EXECUTABLE protoc)
|
||||
find_program(GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
|
||||
# Add vcpkg paths to the search
|
||||
find_program(PROTOC_EXECUTABLE protoc
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-linux/tools/protobuf
|
||||
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/protobuf
|
||||
REQUIRED
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_program(GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin
|
||||
PATHS
|
||||
${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-linux/tools/grpc
|
||||
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/grpc
|
||||
REQUIRED
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
|
||||
if(NOT PROTOC_EXECUTABLE)
|
||||
message(FATAL_ERROR "protoc not found! Install protobuf compiler")
|
||||
@@ -16,6 +31,9 @@ if(NOT GRPC_CPP_PLUGIN_EXECUTABLE)
|
||||
message(FATAL_ERROR "grpc_cpp_plugin not found! Install gRPC with C++ plugin")
|
||||
endif()
|
||||
|
||||
message(STATUS "Found protoc: ${PROTOC_EXECUTABLE}")
|
||||
message(STATUS "Found grpc_cpp_plugin: ${GRPC_CPP_PLUGIN_EXECUTABLE}")
|
||||
|
||||
set(PROTO_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/messages.proto
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/services.proto
|
||||
@@ -57,8 +75,7 @@ target_include_directories(proto_static PUBLIC
|
||||
${PROTO_OUT}
|
||||
)
|
||||
|
||||
target_link_libraries(proto_static PRIVATE
|
||||
target_link_libraries(proto_static PUBLIC
|
||||
protobuf::libprotobuf
|
||||
gRPC::grpc
|
||||
gRPC::grpc++
|
||||
)
|
||||
|
||||
9
vcpkg-configuration.json
Normal file
9
vcpkg-configuration.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"registries": [
|
||||
{
|
||||
"kind": "artifact",
|
||||
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
|
||||
"name": "microsoft"
|
||||
}
|
||||
]
|
||||
}
|
||||
7
vcpkg.json
Normal file
7
vcpkg.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"dependencies": [
|
||||
"grpc",
|
||||
"protobuf"
|
||||
],
|
||||
"builtin-baseline": "ac7af7424cbaf9057cb246b620f455303dccd6ed"
|
||||
}
|
||||
Reference in New Issue
Block a user