@ -48,6 +48,12 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set ( PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/" )
set ( PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/" )
project ( ${ PACKAGE_NAME } C CXX )
project ( ${ PACKAGE_NAME } C CXX )
if ( NOT MSVC )
set ( gRPC_INSTALL ON CACHE BOOL "Generate installation target" )
else ( )
set ( gRPC_INSTALL OFF CACHE BOOL "Generate installation target" )
endif ( )
set ( gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library" )
set ( gRPC_ZLIB_PROVIDER "module" CACHE STRING "Provider of zlib library" )
set_property ( CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package" )
set_property ( CACHE gRPC_ZLIB_PROVIDER PROPERTY STRINGS "module" "package" )
@ -59,6 +65,10 @@ set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package")
set ( gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library" )
set ( gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library" )
if ( MSVC )
add_definitions ( -D_WIN32_WINNT=0x600 )
endif ( )
if ( gRPC_USE_PROTO_LITE )
if ( gRPC_USE_PROTO_LITE )
set ( _gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite" )
set ( _gRPC_PROTOBUF_LIBRARY_NAME "libprotobuf-lite" )
add_definitions ( "-DGRPC_USE_PROTO_LITE" )
add_definitions ( "-DGRPC_USE_PROTO_LITE" )
@ -98,6 +108,7 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
set ( PROTOBUF_ROOT_DIR ${ CMAKE_CURRENT_SOURCE_DIR } /third_party/protobuf )
set ( PROTOBUF_ROOT_DIR ${ CMAKE_CURRENT_SOURCE_DIR } /third_party/protobuf )
endif ( )
endif ( )
if ( EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt" )
if ( EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt" )
set ( protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries" )
add_subdirectory ( ${ PROTOBUF_ROOT_DIR } /cmake third_party/protobuf )
add_subdirectory ( ${ PROTOBUF_ROOT_DIR } /cmake third_party/protobuf )
if ( TARGET ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
if ( TARGET ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
set ( _gRPC_PROTOBUF_LIBRARIES ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
set ( _gRPC_PROTOBUF_LIBRARIES ${ _gRPC_PROTOBUF_LIBRARY_NAME } )
@ -270,11 +281,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS gpr EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS gpr EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc
add_library ( grpc
@ -527,11 +540,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc_cronet
add_library ( grpc_cronet
@ -757,11 +772,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc_cronet EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_cronet EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc_unsecure
add_library ( grpc_unsecure
@ -981,11 +998,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc_unsecure EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_unsecure EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc++
add_library ( grpc++
@ -1149,11 +1168,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc++ EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc++ EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc++_reflection
add_library ( grpc++_reflection
@ -1242,11 +1263,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc++_reflection EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc++_reflection EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc++_unsecure
add_library ( grpc++_unsecure
@ -1406,11 +1429,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc++_unsecure EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc++_unsecure EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc_plugin_support
add_library ( grpc_plugin_support
@ -1446,11 +1471,13 @@ foreach(_hdr
endforeach ( )
endforeach ( )
install ( TARGETS grpc_plugin_support EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_plugin_support EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_library ( grpc_csharp_ext
add_library ( grpc_csharp_ext
@ -1473,11 +1500,13 @@ target_link_libraries(grpc_csharp_ext
install ( TARGETS grpc_csharp_ext EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_csharp_ext EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
@ -1500,11 +1529,13 @@ target_link_libraries(gen_hpack_tables
)
)
install ( TARGETS gen_hpack_tables EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS gen_hpack_tables EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( gen_legal_metadata_characters
add_executable ( gen_legal_metadata_characters
@ -1522,11 +1553,13 @@ target_include_directories(gen_legal_metadata_characters
install ( TARGETS gen_legal_metadata_characters EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS gen_legal_metadata_characters EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_create_jwt
add_executable ( grpc_create_jwt
@ -1549,11 +1582,13 @@ target_link_libraries(grpc_create_jwt
)
)
install ( TARGETS grpc_create_jwt EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_create_jwt EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_print_google_default_creds_token
add_executable ( grpc_print_google_default_creds_token
@ -1575,11 +1610,13 @@ target_link_libraries(grpc_print_google_default_creds_token
)
)
install ( TARGETS grpc_print_google_default_creds_token EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_print_google_default_creds_token EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_verify_jwt
add_executable ( grpc_verify_jwt
@ -1601,11 +1638,13 @@ target_link_libraries(grpc_verify_jwt
)
)
install ( TARGETS grpc_verify_jwt EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_verify_jwt EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_cpp_plugin
add_executable ( grpc_cpp_plugin
@ -1627,11 +1666,13 @@ target_link_libraries(grpc_cpp_plugin
)
)
install ( TARGETS grpc_cpp_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_cpp_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_csharp_plugin
add_executable ( grpc_csharp_plugin
@ -1653,11 +1694,13 @@ target_link_libraries(grpc_csharp_plugin
)
)
install ( TARGETS grpc_csharp_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_csharp_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_node_plugin
add_executable ( grpc_node_plugin
@ -1679,11 +1722,13 @@ target_link_libraries(grpc_node_plugin
)
)
install ( TARGETS grpc_node_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_node_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_objective_c_plugin
add_executable ( grpc_objective_c_plugin
@ -1705,11 +1750,13 @@ target_link_libraries(grpc_objective_c_plugin
)
)
install ( TARGETS grpc_objective_c_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_objective_c_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_python_plugin
add_executable ( grpc_python_plugin
@ -1731,11 +1778,13 @@ target_link_libraries(grpc_python_plugin
)
)
install ( TARGETS grpc_python_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_python_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
add_executable ( grpc_ruby_plugin
add_executable ( grpc_ruby_plugin
@ -1757,11 +1806,13 @@ target_link_libraries(grpc_ruby_plugin
)
)
install ( TARGETS grpc_ruby_plugin EXPORT gRPCTargets
if ( gRPC_INSTALL )
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
install ( TARGETS grpc_ruby_plugin EXPORT gRPCTargets
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ B I N D I R }
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
A R C H I V E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ L I B D I R }
)
endif ( )
@ -1770,10 +1821,12 @@ install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets
install ( EXPORT gRPCTargets
if ( gRPC_INSTALL )
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ C M A K E D I R }
install ( EXPORT gRPCTargets
N A M E S P A C E g R P C : :
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ C M A K E D I R }
)
N A M E S P A C E g R P C : :
)
endif ( )
foreach ( _config gRPCConfig gRPCConfigVersion )
foreach ( _config gRPCConfig gRPCConfigVersion )
configure_file ( tools/cmake/ ${ _config } .cmake.in
configure_file ( tools/cmake/ ${ _config } .cmake.in