From 8e9bf962a45a82f1c2eb5858e29fa89a3a60b564 Mon Sep 17 00:00:00 2001 From: Alexey Firago Date: Mon, 30 Oct 2017 23:24:49 +0300 Subject: [PATCH 1/4] CMakeLists.txt: Fix libraries installation for Linux * Set libs versions as in Makefile Signed-off-by: Alexey Firago %% original patch: 0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch --- CMakeLists.txt | 55 +++++++++++++++++++++++++++++++++++ CMakeLists.txt => CMakeLists.txt.orig | 0 2 files changed, 55 insertions(+) copy CMakeLists.txt => CMakeLists.txt.orig (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1a49df..13e64ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,15 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") project(${PACKAGE_NAME} C CXX) +set (CORE_VERSION_MAJOR "4") +set (CORE_VERSION "4.0.0") + +set (CPP_VERSION_MAJOR "1") +set (CPP_VERSION "${PACKAGE_VERSION}") + +set (CSHARP_VERSION_MAJOR "1") +set (CSHARP_VERSION "${PACKAGE_VERSION}") + set(gRPC_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(gRPC_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") set(gRPC_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") @@ -841,6 +850,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET gpr PROPERTY VERSION ${CORE_VERSION}) + set_property(TARGET gpr PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) +endif() target_include_directories(gpr PUBLIC $ $ @@ -1221,6 +1234,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc PROPERTY VERSION ${CORE_VERSION}) + set_property(TARGET grpc PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) +endif() target_include_directories(grpc PUBLIC $ $ @@ -1535,6 +1552,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc_cronet PROPERTY VERSION ${CORE_VERSION}) + set_property(TARGET grpc_cronet PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) +endif() target_include_directories(grpc_cronet PUBLIC $ $ @@ -2377,6 +2398,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc_unsecure PROPERTY VERSION ${CORE_VERSION}) + set_property(TARGET grpc_unsecure PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) +endif() target_include_directories(grpc_unsecure PUBLIC $ $ @@ -2592,6 +2617,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc++ PROPERTY VERSION ${CPP_VERSION}) + set_property(TARGET grpc++ PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) +endif() target_include_directories(grpc++ PUBLIC $ $ @@ -3078,6 +3107,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc++_cronet PROPERTY VERSION ${CPP_VERSION}) + set_property(TARGET grpc++_cronet PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) +endif() target_include_directories(grpc++_cronet PUBLIC $ $ @@ -3282,6 +3315,11 @@ protobuf_generate_grpc_cpp( src/proto/grpc/status/status.proto ) +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc++_error_details PROPERTY VERSION ${CPP_VERSION}) + set_property(TARGET grpc++_error_details PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) +endif() + target_include_directories(grpc++_error_details PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} @@ -3408,6 +3446,11 @@ protobuf_generate_grpc_cpp( src/proto/grpc/reflection/v1alpha/reflection.proto ) +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc++_reflection PROPERTY VERSION ${CPP_VERSION}) + set_property(TARGET grpc++_reflection PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) +endif() + target_include_directories(grpc++_reflection PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} @@ -3827,6 +3870,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc++_unsecure PROPERTY VERSION ${CPP_VERSION}) + set_property(TARGET grpc++_unsecure PROPERTY SOVERSION ${CPP_VERSION_MAJOR}) +endif() target_include_directories(grpc++_unsecure PUBLIC $ $ @@ -4140,6 +4187,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc_plugin_support PROPERTY VERSION ${CORE_VERSION}) + set_property(TARGET grpc_plugin_support PROPERTY SOVERSION ${CORE_VERSION_MAJOR}) +endif() target_include_directories(grpc_plugin_support PUBLIC $ $ @@ -4649,6 +4700,10 @@ if(WIN32 AND MSVC) endif() endif() +if(_gRPC_PLATFORM_LINUX) + set_property(TARGET grpc_csharp_ext PROPERTY VERSION ${CSHARP_VERSION}) + set_property(TARGET grpc_csharp_ext PROPERTY SOVERSION ${CSHARP_VERSION_MAJOR}) +endif() target_include_directories(grpc_csharp_ext PUBLIC $ $ diff --git a/CMakeLists.txt b/CMakeLists.txt.orig similarity index 100% copy from CMakeLists.txt copy to CMakeLists.txt.orig -- 2.16.1