diff --git a/.gitignore b/.gitignore index d497d0a..490019b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # .vs, .vscode must be ignored .vs/ .vscode/ +CAPI/build diff --git a/CAPI/CMakeLists.txt b/CAPI/CMakeLists.txt new file mode 100644 index 0000000..6741c18 --- /dev/null +++ b/CAPI/CMakeLists.txt @@ -0,0 +1,26 @@ +# 临时CMakeLists,仅供本地调试用 +cmake_minimum_required(VERSION 3.5) + +project(THUAI6_CAPI VERSION 1.0) + +set(CMAKE_CXX_STANDARD 17) + +aux_source_directory(./API/src CPP_LIST) +aux_source_directory(./proto PROTO_CPP_LIST) + +find_package(Protobuf CONFIG REQUIRED) +find_package(gRPC CONFIG REQUIRED) + +message(STATUS "Using protobuf ${Protobuf_VERSION}") +message(STATUS "Using gRPC ${gRPC_VERSION}") + +add_executable(capi ${CPP_LIST} ${PROTO_CPP_LIST}) + +target_include_directories(capi PUBLIC ${PROJECT_SOURCE_DIR}/proto ${PROJECT_SOURCE_DIR}/API/include) + +target_link_libraries(capi +protobuf::libprotobuf +gRPC::grpc +gRPC::grpc++_reflection +gRPC::grpc++ +) \ No newline at end of file