Skip to content

Instantly share code, notes, and snippets.

@KindDragon
Last active August 11, 2019 17:19
Show Gist options
  • Save KindDragon/2afe238762561c9fc81b9db66ce6aa2f to your computer and use it in GitHub Desktop.
Save KindDragon/2afe238762561c9fc81b9db66ce6aa2f to your computer and use it in GitHub Desktop.
if (gRPC_USE_CONAN)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
if($ENV{VisualStudioVersion} MATCHES "12.")
set(_gRPC_CONAN_COMPILER -s "compiler=Visual Studio" -s compiler.version=12)
elseif($ENV{VisualStudioVersion} MATCHES "14.")
set(_gRPC_CONAN_COMPILER -s "compiler=Visual Studio" -s compiler.version=14)
endif()
if($ENV{Platform} STREQUAL "X64")
set(_gRPC_CONAN_ARCH -s arch=x86_64)
else()
set(_gRPC_CONAN_ARCH -s arch=x86)
endif()
elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio ")
if(${CMAKE_GENERATOR} MATCHES "Visual Studio 12 2013")
set(_gRPC_CONAN_COMPILER -s "compiler=Visual Studio" -s compiler.version=12)
elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio 14 2015")
set(_gRPC_CONAN_COMPILER -s "compiler=Visual Studio" -s compiler.version=14)
endif()
if(${CMAKE_GENERATOR} MATCHES " Win64$")
set(_gRPC_CONAN_ARCH -s arch=x86_64)
else()
set(_gRPC_CONAN_ARCH -s arch=x86)
endif()
endif()
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(_gRPC_CONAN_BUILD_TYPE -s compiler.runtime=MDd -s build_type=Debug)
else()
set(_gRPC_CONAN_BUILD_TYPE -s compiler.runtime=MD -s build_type=Release)
endif()
set(_gRPC_CONAN_COMMAND conan install .. ${_gRPC_CONAN_ARCH} ${_gRPC_CONAN_COMPILER} ${_gRPC_CONAN_BUILD_TYPE} -s os=Windows)
execute_process(COMMAND ${_gRPC_CONAN_COMMAND})
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment