Started work on integrating vcpkg, doesn't quite work yet
This commit is contained in:
@@ -16,7 +16,23 @@
|
|||||||
"type": "BOOL",
|
"type": "BOOL",
|
||||||
"value": "ON"
|
"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_PREFIX_PATH": "$env{HOME}/Qt/6.10.2/gcc_64/lib/cmake;${sourceDir}/vcpkg_installed/x64-linux",
|
||||||
|
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||||
|
"VCPKG_TARGET_TRIPLET": "x64-linux",
|
||||||
|
"VCPKG_MANIFEST_MODE": "ON",
|
||||||
|
"VCPKG_MANIFEST_DIR": "${sourceDir}",
|
||||||
|
"VCPKG_INSTALLED_DIR": "${sourceDir}/vcpkg_installed",
|
||||||
|
"CMAKE_FIND_USE_CMAKE_SYSTEM_PATH": "OFF",
|
||||||
|
"CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH": "OFF",
|
||||||
|
"CMAKE_SYSTEM_IGNORE_PATH": "/usr/include;/usr/lib;/usr/local/include;/usr/local/lib"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,8 +5,23 @@ project(proto LANGUAGES CXX)
|
|||||||
find_package(protobuf CONFIG REQUIRED)
|
find_package(protobuf CONFIG REQUIRED)
|
||||||
find_package(gRPC CONFIG REQUIRED)
|
find_package(gRPC CONFIG REQUIRED)
|
||||||
|
|
||||||
find_program(PROTOC_EXECUTABLE protoc)
|
# Add vcpkg paths to the search
|
||||||
find_program(GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
|
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)
|
if(NOT PROTOC_EXECUTABLE)
|
||||||
message(FATAL_ERROR "protoc not found! Install protobuf compiler")
|
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")
|
message(FATAL_ERROR "grpc_cpp_plugin not found! Install gRPC with C++ plugin")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Found protoc: ${PROTOC_EXECUTABLE}")
|
||||||
|
message(STATUS "Found grpc_cpp_plugin: ${GRPC_CPP_PLUGIN_EXECUTABLE}")
|
||||||
|
|
||||||
set(PROTO_FILES
|
set(PROTO_FILES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/messages.proto
|
${CMAKE_CURRENT_SOURCE_DIR}/messages.proto
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/services.proto
|
${CMAKE_CURRENT_SOURCE_DIR}/services.proto
|
||||||
@@ -59,6 +77,5 @@ target_include_directories(proto_static PUBLIC
|
|||||||
|
|
||||||
target_link_libraries(proto_static PRIVATE
|
target_link_libraries(proto_static PRIVATE
|
||||||
protobuf::libprotobuf
|
protobuf::libprotobuf
|
||||||
gRPC::grpc
|
|
||||||
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