cmake update for windows

This commit is contained in:
einhornimmond - MarkX 2020-10-08 11:51:23 +02:00 committed by Ulf Gebhardt
parent 5c53cf3fd1
commit 9167270149
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
3 changed files with 18 additions and 26 deletions

View File

@ -101,8 +101,11 @@ set(GRPC_PROTOBUF_PATH "${GRPC_PATH}/third_party/protobuf")
if(WIN32)
find_library(MYSQL_LIBRARIES mariadbclient.lib PATHS "${MARIADB_CONNECTOR_PATH}/Release" REQUIRED)
find_library(MYSQL_LIBRARIES mariadbclient PATHS "${MARIADB_CONNECTOR_PATH}/Release" REQUIRED)
find_library(COMPILED_MARIADB_CLIENT_DEBUG mariadbclient PATHS "${MARIADB_CONNECTOR_PATH}/Debug" REQUIRED)
find_library(CONAN_OPENSSL_SSL ssleay32 PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
find_library(CONAN_OPENSSL_CRYPTO libeay32 PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
set(GRPC_PATH "${GRPC_PATH}/Debug")
set(GRPC_ABSL_PATH "${GRPC_ABSL_PATH}/Debug")
@ -111,15 +114,6 @@ if(WIN32)
set(GRPC_RE2_PATH "${GRPC_RE2_PATH}/Debug")
set(GRPC_PROTOBUF_DEBUG_PATH "${GRPC_PROTOBUF_PATH}/Debug")
find_library(PROTOBUF_LIB_DEBUG libprotobufd PATHS ${GRPC_PROTOBUF_DEBUG_PATH} REQUIRED)
find_library(PROTOBUF_LIB_LITE_DEBUG libprotobuf-lited PATHS ${GRPC_PROTOBUF_DEBUG_PATH} REQUIRED)
find_library(PROTOBUF_LIBC_DEBUG libprotocd PATHS ${GRPC_PROTOBUF_DEBUG_PATH} REQUIRED)
set(PROTOBUF_DEBUG_LIBS
${PROTOBUF_LIB_DEBUG}
${PROTOBUF_LIB_LITE_DEBUG}
${PROTOBUF_LIBC_DEBUG}
)
list(REMOVE_ITEM CONAN_LIBS "libeay32.lib")
list(REMOVE_ITEM CONAN_LIBS "ssleay32.lib")
@ -128,6 +122,8 @@ if(WIN32)
else (WIN32)
find_library(MYSQL_LIBRARIES libmariadb.so PATHS ${MARIADB_CONNECTOR_PATH} REQUIRED)
find_library(CONAN_OPENSSL_SSL ssl PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
find_library(CONAN_OPENSSL_CRYPTO crypto PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
set(GRPC_PROTOBUF_DEBUG_PATH "${GRPC_PROTOBUF_PATH}")
list(REMOVE_ITEM CONAN_LIBS "ssl")
@ -138,10 +134,8 @@ endif(WIN32)
# load same ssl version like used from poco
find_package(OpenSSL PATHS . NO_DEFAULT_PATH)
#find_package(OpenSSL PATHS . NO_DEFAULT_PATH)
find_library(CONAN_OPENSSL_SSL ssl PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
find_library(CONAN_OPENSSL_CRYPTO crypto PATHS ${CONAN_LIB_DIRS_OPENSSL} REQUIRED NO_DEFAULT_PATH )
set(CONAN_OPENSSL_CUSTOM_LIBS
${CONAN_OPENSSL_SSL}

16
README
View File

@ -9,15 +9,6 @@ cmake -DWITH_SSL=OFF ..
cd ../../../
cd dependencies/grpc
mkdir build
cd build
cmake ..
make
# under windows build at least release for protoc.exe and grpc c++ plugin
cd ../../../
./unix_parse_proto.sh
# get more dependencies with conan (need conan from https://conan.io/)
mkdir build && cd build
# // not used anymore
@ -29,3 +20,10 @@ conan install ..
# build Makefile with cmake
cmake ..
make grpc
# under windows build at least release for protoc.exe and grpc c++ plugin
cd ../
./unix_parse_proto.sh
cd build
make

View File

@ -5,15 +5,15 @@ fi
if [ ! -d "./src/cpp/proto/gradido" ] ; then
mkdir ./src/cpp/proto/gradido
fi
PROTOC_PATH=./dependencies/grpc/_build/third_party/protobuf/Release
CPP_PLUGIN_PATH=./dependencies/grpc/_build/Release
$PROTOC_PATH/protoc --cpp_out=./src/cpp/proto --proto_path=./src/proto ./src/proto/gradido/*.proto
PROTOC_PATH=build/bin
CPP_PLUGIN_PATH=build/bin
$PROTOC_PATH/protoc.exe --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
GOOGLE_PROTOBUF_INCLUDES=./dependencies/grpc/third_party/protobuf/src
$PROTOC_PATH/protoc --plugin=protoc-gen-grpc=$CPP_PLUGIN_PATH/grpc_cpp_plugin.exe --cpp_out=./src/cpp/proto/hedera --grpc_out=./src/cpp/proto/hedera --proto_path=$GOOGLE_PROTOBUF_INCLUDES --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto
$PROTOC_PATH/protoc.exe --plugin=protoc-gen-grpc=$CPP_PLUGIN_PATH/grpc_cpp_plugin.exe --cpp_out=./src/cpp/proto/hedera --grpc_out=./src/cpp/proto/hedera --proto_path=$GOOGLE_PROTOBUF_INCLUDES --proto_path=./src/proto/hedera/hedera-protobuf/src/main/proto ./src/proto/hedera/hedera-protobuf/src/main/proto/*.proto