include grpc manuell in cmake project, debug windows, other configurations are to come

This commit is contained in:
einhornimmond - MarkX 2020-08-24 18:24:48 +02:00
parent cce7b7d4a9
commit 1206b6105d
4 changed files with 19 additions and 2 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "dependencies/spirit-po"]
path = dependencies/spirit-po
url = https://github.com/cbeck88/spirit-po.git
[submodule "dependencies/grpc"]
path = dependencies/grpc
url = https://github.com/grpc/grpc.git

View File

@ -11,6 +11,7 @@ include_directories(
"dependencies/mariadb-connector-c/include"
"dependencies/mariadb-connector-c/build/include"
"dependencies/spirit-po/include"
"dependencies/grpc/include"
"src/cpp/proto"
#"dependencies/mariadb-connector-c/build/include"
#"dependencies/mariadb-connector-c/include"
@ -91,6 +92,10 @@ find_library(MYSQL_LIBRARIES mariadbclient.lib PATHS "dependencies/mariadb-conne
#find_library(MYSQL_LIBRARIES_DEBUG mariadbclient.lib PATHS "import/mariadb/lib/debug")
find_library(COMPILED_MARIADB_CLIENT_DEBUG mariadbclient PATHS "dependencies/mariadb-connector-c/build/libmariadb/Debug" REQUIRED)
find_library(IROHA_ED25519 ed25519 PATHS "dependencies/iroha-ed25519/build/Debug" REQUIRED)
set(GRPC_PATH "dependencies/grpc/_build/Debug")
find_library(GRPC_PLUSPLUS grpc++ PATHS ${GRPC_PATH} REQUIRED)
find_library(GRPC_REFLECTION grpc++_reflection PATHS ${GRPC_PATH} REQUIRED)
set(GRPC_LIBS ${GRPC_PLUSPLUS} ${GRPC_REFLECTION})
set(MYSQL_INCLUDE_DIR "dependencies/mariadb-connector-c/include")
#set(POCO_DEBUG_PATH "I:/FremdCode/C++/poco/win64/lib/Debug")
@ -139,6 +144,7 @@ target_link_libraries(Gradido_LoginServer ${CONAN_LIBS} ${IROHA_ED25519})
if(WIN32)
TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi)
TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi)
TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${GRPC_LIBS})
else(WIN32)
target_link_libraries(Gradido_LoginServer libmariadb protoc protobuf -pthread)
endif(WIN32)

7
README
View File

@ -20,6 +20,13 @@ cmake -DWITH_SSL=OFF ..
cd ../../../
cd dependencies/grpc
mkdir _build
cd _build
cmake ..
make
cd ../../../
# get more dependencies with conan (need conan from https://conan.io/)
mkdir build && cd build
conan remote add inexor https://api.bintray.com/conan/inexorgame/inexor-conan

View File

@ -6,12 +6,13 @@ if [ ! -d "./src/cpp/proto/gradido" ] ; then
mkdir ./src/cpp/proto/gradido
fi
protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto
./protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto
if [ ! -d "./src/cpp/proto/hedera" ] ; then
mkdir ./src/cpp/proto/hedera
fi
protoc --cpp_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto
./protoc --plugin=protoc-gen-grpc=./grpc_cpp_plugin.exe --cpp_out=./src/cpp/proto/hedera --grpc_out=./src/cpp/proto/hedera --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto