Merge pull request #7762 from KindDragon/master

Fix CMake for windows (VS2015)
pull/7794/head
Nicolas Noble 9 years ago committed by GitHub
commit 6cfc80edaf
  1. 1
      .gitignore
  2. 261
      CMakeLists.txt
  3. 33
      templates/CMakeLists.txt.template
  4. 15
      vsprojects/README.md

1
.gitignore vendored

@ -1,4 +1,5 @@
# C/C++ build outputs # C/C++ build outputs
.build/
bins bins
gens gens
libs libs

@ -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})
@ -269,11 +280,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS gpr EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS gpr EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc add_library(grpc
@ -525,11 +538,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc_cronet add_library(grpc_cronet
@ -754,11 +769,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc_cronet EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_cronet EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc_unsecure add_library(grpc_unsecure
@ -977,11 +994,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc_unsecure EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_unsecure EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc++ add_library(grpc++
@ -1145,11 +1164,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc++ EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc++ EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc++_reflection add_library(grpc++_reflection
@ -1238,11 +1259,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc++_reflection EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc++_reflection EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc++_unsecure add_library(grpc++_unsecure
@ -1402,11 +1425,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc++_unsecure EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc++_unsecure EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc_plugin_support add_library(grpc_plugin_support
@ -1442,11 +1467,13 @@ foreach(_hdr
endforeach() endforeach()
install(TARGETS grpc_plugin_support EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_plugin_support EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_library(grpc_csharp_ext add_library(grpc_csharp_ext
@ -1469,11 +1496,13 @@ target_link_libraries(grpc_csharp_ext
install(TARGETS grpc_csharp_ext EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_csharp_ext EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
@ -1496,11 +1525,13 @@ target_link_libraries(gen_hpack_tables
) )
install(TARGETS gen_hpack_tables EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS gen_hpack_tables EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(gen_legal_metadata_characters add_executable(gen_legal_metadata_characters
@ -1518,11 +1549,13 @@ target_include_directories(gen_legal_metadata_characters
install(TARGETS gen_legal_metadata_characters EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS gen_legal_metadata_characters EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_create_jwt add_executable(grpc_create_jwt
@ -1545,11 +1578,13 @@ target_link_libraries(grpc_create_jwt
) )
install(TARGETS grpc_create_jwt EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_create_jwt EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_print_google_default_creds_token add_executable(grpc_print_google_default_creds_token
@ -1571,11 +1606,13 @@ target_link_libraries(grpc_print_google_default_creds_token
) )
install(TARGETS grpc_print_google_default_creds_token EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_print_google_default_creds_token EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_verify_jwt add_executable(grpc_verify_jwt
@ -1597,11 +1634,13 @@ target_link_libraries(grpc_verify_jwt
) )
install(TARGETS grpc_verify_jwt EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_verify_jwt EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_cpp_plugin add_executable(grpc_cpp_plugin
@ -1623,11 +1662,13 @@ target_link_libraries(grpc_cpp_plugin
) )
install(TARGETS grpc_cpp_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_cpp_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_csharp_plugin add_executable(grpc_csharp_plugin
@ -1649,11 +1690,13 @@ target_link_libraries(grpc_csharp_plugin
) )
install(TARGETS grpc_csharp_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_csharp_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_node_plugin add_executable(grpc_node_plugin
@ -1675,11 +1718,13 @@ target_link_libraries(grpc_node_plugin
) )
install(TARGETS grpc_node_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_node_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_objective_c_plugin add_executable(grpc_objective_c_plugin
@ -1701,11 +1746,13 @@ target_link_libraries(grpc_objective_c_plugin
) )
install(TARGETS grpc_objective_c_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_objective_c_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_python_plugin add_executable(grpc_python_plugin
@ -1727,11 +1774,13 @@ target_link_libraries(grpc_python_plugin
) )
install(TARGETS grpc_python_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_python_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
add_executable(grpc_ruby_plugin add_executable(grpc_ruby_plugin
@ -1753,11 +1802,13 @@ target_link_libraries(grpc_ruby_plugin
) )
install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
@ -1766,10 +1817,12 @@ install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets
install(EXPORT gRPCTargets if (gRPC_INSTALL)
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} install(EXPORT gRPCTargets
NAMESPACE gRPC:: DESTINATION ${CMAKE_INSTALL_CMAKEDIR}
) NAMESPACE gRPC::
)
endif()
foreach(_config gRPCConfig gRPCConfigVersion) foreach(_config gRPCConfig gRPCConfigVersion)
configure_file(tools/cmake/${_config}.cmake.in configure_file(tools/cmake/${_config}.cmake.in

@ -66,6 +66,12 @@
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/") set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
project(<%text>${PACKAGE_NAME}</%text> C CXX) project(<%text>${PACKAGE_NAME}</%text> 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")
@ -77,6 +83,10 @@
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")
@ -116,6 +126,7 @@
set(PROTOBUF_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/protobuf) set(PROTOBUF_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/protobuf)
endif() endif()
if(EXISTS "<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake/CMakeLists.txt") if(EXISTS "<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake/CMakeLists.txt")
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries")
add_subdirectory(<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake third_party/protobuf) add_subdirectory(<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake third_party/protobuf)
if(TARGET <%text>${_gRPC_PROTOBUF_LIBRARY_NAME}</%text>) if(TARGET <%text>${_gRPC_PROTOBUF_LIBRARY_NAME}</%text>)
set(_gRPC_PROTOBUF_LIBRARIES <%text>${_gRPC_PROTOBUF_LIBRARY_NAME}</%text>) set(_gRPC_PROTOBUF_LIBRARIES <%text>${_gRPC_PROTOBUF_LIBRARY_NAME}</%text>)
@ -255,17 +266,21 @@
</%def> </%def>
<%def name="cc_install(tgt)"> <%def name="cc_install(tgt)">
install(TARGETS ${tgt.name} EXPORT gRPCTargets if (gRPC_INSTALL)
RUNTIME DESTINATION <%text>${CMAKE_INSTALL_BINDIR}</%text> install(TARGETS ${tgt.name} EXPORT gRPCTargets
LIBRARY DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text> RUNTIME DESTINATION <%text>${CMAKE_INSTALL_BINDIR}</%text>
ARCHIVE DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text> LIBRARY DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text>
) ARCHIVE DESTINATION <%text>${CMAKE_INSTALL_LIBDIR}</%text>
)
endif()
</%def> </%def>
install(EXPORT gRPCTargets if (gRPC_INSTALL)
DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR}</%text> install(EXPORT gRPCTargets
NAMESPACE gRPC:: DESTINATION <%text>${CMAKE_INSTALL_CMAKEDIR}</%text>
) NAMESPACE gRPC::
)
endif()
foreach(_config gRPCConfig gRPCConfigVersion) foreach(_config gRPCConfig gRPCConfigVersion)
configure_file(tools/cmake/<%text>${_config}</%text>.cmake.in configure_file(tools/cmake/<%text>${_config}</%text>.cmake.in

@ -89,3 +89,18 @@ $ cmake -G "Visual Studio 12 2013"
2. Open solution `third_party\protobuf\cmake\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step. 2. Open solution `third_party\protobuf\cmake\protobuf.sln` and build it in Release mode. That will build libraries `libprotobuf.lib` and `libprotoc.lib` needed for the next step.
3. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...) 3. Open solution `vsprojects\grpc_protoc_plugins.sln` and build it in Release mode. As a result, you should obtain a set of gRPC protoc plugin binaries (`grpc_cpp_plugin.exe`, `grpc_csharp_plugin.exe`, ...)
#Building using CMake (with BoringSSL)
1. Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`)
2. Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
2. Install [Go](https://golang.org/dl/) (`choco install golang`)
3. Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`)
4. Update boringssl sumbodule to `master`
5. Run this commads in grpc directory:
```
> md .build
> cd .build
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake --build .
```

Loading…
Cancel
Save