소스 검색

Remove auto-download dependency system from project

- Remove gtest autodownload
- Add gtest ad subproject
- Remove deprecated gRPCBuild
Alexey Edelev 5 년 전
부모
커밋
c640758058
8개의 변경된 파일18개의 추가작업 그리고 418개의 파일을 삭제
  1. 3 0
      .gitmodules
  2. 1 0
      3rdparty/googletest
  3. 13 12
      CMakeLists.txt
  4. 0 17
      cmake/DownloadProject.CMakeLists.cmake.in
  5. 0 182
      cmake/DownloadProject.cmake
  6. 1 1
      cmake/ProtobufLookup.cmake
  7. 0 70
      cmake/QtProtobufFunctions.cmake.in
  8. 0 136
      cmake/gRPCBuild.cmake

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "3rdparty/grpc"]
 	path = 3rdparty/grpc
 	url = https://github.com/grpc/grpc
+[submodule "3rdparty/googletest"]
+	path = 3rdparty/googletest
+	url = https://github.com/google/googletest.git

+ 1 - 0
3rdparty/googletest

@@ -0,0 +1 @@
+Subproject commit 703bd9caab50b139428cea1aaff9974ebee5742e

+ 13 - 12
CMakeLists.txt

@@ -114,22 +114,23 @@ if(NOT gRPC_FOUND)
     set(QTPROTOBUF_MAKE_EXAMPLES OFF)
 endif()
 
+include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtProtobufCommon.cmake")
+
 if(QTPROTOBUF_MAKE_TESTS)
-    find_package(GTest)
-    if(NOT GTest_FOUND)
-        include(cmake/DownloadProject.cmake)
-        download_project(PROJ                GTest
-            GIT_REPOSITORY      https://github.com/google/googletest.git
-            GIT_TAG             v1.8.x
-            )
-        # uncomment if gmock is going to be needed
+    if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/googletest/CMakeLists.txt")
         set(BUILD_GMOCK OFF CACHE BOOL "Disable gmock build functionality" FORCE)
         set(gtest_force_shared_crt ON CACHE BOOL "Enable shared crt" FORCE)
-        add_subdirectory(${GTest_SOURCE_DIR} ${GTest_BINARY_DIR})
+        add_subdirectory("3rdparty/googletest")
+        set(GTest_FOUND TRUE)
+    else()
+        find_package(GTest)
+    endif()
+    if(GTest_FOUND)
+        enable_testing()
+        add_subdirectory("tests")
+    else()
+        message(STATUS "-- Force disable test")
     endif()
-
-    enable_testing()
-    add_subdirectory("tests")
 endif()
 
 if(QTPROTOBUF_MAKE_EXAMPLES)

+ 0 - 17
cmake/DownloadProject.CMakeLists.cmake.in

@@ -1,17 +0,0 @@
-# Distributed under the OSI-approved MIT License.  See accompanying
-# file LICENSE or https://github.com/Crascit/DownloadProject for details.
-
-cmake_minimum_required(VERSION 2.8.2)
-
-project(${DL_ARGS_PROJ}-download NONE)
-
-include(ExternalProject)
-ExternalProject_Add(${DL_ARGS_PROJ}-download
-                    ${DL_ARGS_UNPARSED_ARGUMENTS}
-                    SOURCE_DIR          "${DL_ARGS_SOURCE_DIR}"
-                    BINARY_DIR          "${DL_ARGS_BINARY_DIR}"
-                    CONFIGURE_COMMAND   ""
-                    BUILD_COMMAND       ""
-                    INSTALL_COMMAND     ""
-                    TEST_COMMAND        ""
-)

+ 0 - 182
cmake/DownloadProject.cmake

@@ -1,182 +0,0 @@
-# Distributed under the OSI-approved MIT License.  See accompanying
-# file LICENSE or https://github.com/Crascit/DownloadProject for details.
-#
-# MODULE:   DownloadProject
-#
-# PROVIDES:
-#   download_project( PROJ projectName
-#                    [PREFIX prefixDir]
-#                    [DOWNLOAD_DIR downloadDir]
-#                    [SOURCE_DIR srcDir]
-#                    [BINARY_DIR binDir]
-#                    [QUIET]
-#                    ...
-#   )
-#
-#       Provides the ability to download and unpack a tarball, zip file, git repository,
-#       etc. at configure time (i.e. when the cmake command is run). How the downloaded
-#       and unpacked contents are used is up to the caller, but the motivating case is
-#       to download source code which can then be included directly in the build with
-#       add_subdirectory() after the call to download_project(). Source and build
-#       directories are set up with this in mind.
-#
-#       The PROJ argument is required. The projectName value will be used to construct
-#       the following variables upon exit (obviously replace projectName with its actual
-#       value):
-#
-#           projectName_SOURCE_DIR
-#           projectName_BINARY_DIR
-#
-#       The SOURCE_DIR and BINARY_DIR arguments are optional and would not typically
-#       need to be provided. They can be specified if you want the downloaded source
-#       and build directories to be located in a specific place. The contents of
-#       projectName_SOURCE_DIR and projectName_BINARY_DIR will be populated with the
-#       locations used whether you provide SOURCE_DIR/BINARY_DIR or not.
-#
-#       The DOWNLOAD_DIR argument does not normally need to be set. It controls the
-#       location of the temporary CMake build used to perform the download.
-#
-#       The PREFIX argument can be provided to change the base location of the default
-#       values of DOWNLOAD_DIR, SOURCE_DIR and BINARY_DIR. If all of those three arguments
-#       are provided, then PREFIX will have no effect. The default value for PREFIX is
-#       CMAKE_BINARY_DIR.
-#
-#       The QUIET option can be given if you do not want to show the output associated
-#       with downloading the specified project.
-#
-#       In addition to the above, any other options are passed through unmodified to
-#       ExternalProject_Add() to perform the actual download, patch and update steps.
-#       The following ExternalProject_Add() options are explicitly prohibited (they
-#       are reserved for use by the download_project() command):
-#
-#           CONFIGURE_COMMAND
-#           BUILD_COMMAND
-#           INSTALL_COMMAND
-#           TEST_COMMAND
-#
-#       Only those ExternalProject_Add() arguments which relate to downloading, patching
-#       and updating of the project sources are intended to be used. Also note that at
-#       least one set of download-related arguments are required.
-#
-#       If using CMake 3.2 or later, the UPDATE_DISCONNECTED option can be used to
-#       prevent a check at the remote end for changes every time CMake is run
-#       after the first successful download. See the documentation of the ExternalProject
-#       module for more information. It is likely you will want to use this option if it
-#       is available to you. Note, however, that the ExternalProject implementation contains
-#       bugs which result in incorrect handling of the UPDATE_DISCONNECTED option when
-#       using the URL download method or when specifying a SOURCE_DIR with no download
-#       method. Fixes for these have been created, the last of which is scheduled for
-#       inclusion in CMake 3.8.0. Details can be found here:
-#
-#           https://gitlab.kitware.com/cmake/cmake/commit/bdca68388bd57f8302d3c1d83d691034b7ffa70c
-#           https://gitlab.kitware.com/cmake/cmake/issues/16428
-#
-#       If you experience build errors related to the update step, consider avoiding
-#       the use of UPDATE_DISCONNECTED.
-#
-# EXAMPLE USAGE:
-#
-#   include(DownloadProject)
-#   download_project(PROJ                googletest
-#                    GIT_REPOSITORY      https://github.com/google/googletest.git
-#                    GIT_TAG             master
-#                    UPDATE_DISCONNECTED 1
-#                    QUIET
-#   )
-#
-#   add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
-#
-#========================================================================================
-
-
-set(_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")
-
-include(CMakeParseArguments)
-
-function(download_project)
-
-    set(options QUIET)
-    set(oneValueArgs
-        PROJ
-        PREFIX
-        DOWNLOAD_DIR
-        SOURCE_DIR
-        BINARY_DIR
-        # Prevent the following from being passed through
-        CONFIGURE_COMMAND
-        BUILD_COMMAND
-        INSTALL_COMMAND
-        TEST_COMMAND
-    )
-    set(multiValueArgs "")
-
-    cmake_parse_arguments(DL_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
-    # Hide output if requested
-    if (DL_ARGS_QUIET)
-        set(OUTPUT_QUIET "OUTPUT_QUIET")
-    else()
-        unset(OUTPUT_QUIET)
-        message(STATUS "Downloading/updating ${DL_ARGS_PROJ}")
-    endif()
-
-    # Set up where we will put our temporary CMakeLists.txt file and also
-    # the base point below which the default source and binary dirs will be.
-    # The prefix must always be an absolute path.
-    if (NOT DL_ARGS_PREFIX)
-        set(DL_ARGS_PREFIX "${CMAKE_BINARY_DIR}")
-    else()
-        get_filename_component(DL_ARGS_PREFIX "${DL_ARGS_PREFIX}" ABSOLUTE
-                               BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-    endif()
-    if (NOT DL_ARGS_DOWNLOAD_DIR)
-        set(DL_ARGS_DOWNLOAD_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-download")
-    endif()
-
-    # Ensure the caller can know where to find the source and build directories
-    if (NOT DL_ARGS_SOURCE_DIR)
-        set(DL_ARGS_SOURCE_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-src")
-    endif()
-    if (NOT DL_ARGS_BINARY_DIR)
-        set(DL_ARGS_BINARY_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-build")
-    endif()
-    set(${DL_ARGS_PROJ}_SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" PARENT_SCOPE)
-    set(${DL_ARGS_PROJ}_BINARY_DIR "${DL_ARGS_BINARY_DIR}" PARENT_SCOPE)
-
-    # The way that CLion manages multiple configurations, it causes a copy of
-    # the CMakeCache.txt to be copied across due to it not expecting there to
-    # be a project within a project.  This causes the hard-coded paths in the
-    # cache to be copied and builds to fail.  To mitigate this, we simply
-    # remove the cache if it exists before we configure the new project.  It
-    # is safe to do so because it will be re-generated.  Since this is only
-    # executed at the configure step, it should not cause additional builds or
-    # downloads.
-    file(REMOVE "${DL_ARGS_DOWNLOAD_DIR}/CMakeCache.txt")
-
-    # Create and build a separate CMake project to carry out the download.
-    # If we've already previously done these steps, they will not cause
-    # anything to be updated, so extra rebuilds of the project won't occur.
-    # Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
-    # has this set to something not findable on the PATH.
-    configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
-                   "${DL_ARGS_DOWNLOAD_DIR}/CMakeLists.txt")
-    execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-                        -D "CMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}"
-                        .
-                    RESULT_VARIABLE result
-                    ${OUTPUT_QUIET}
-                    WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
-    )
-    if(result)
-        message(FATAL_ERROR "CMake step for ${DL_ARGS_PROJ} failed: ${result}")
-    endif()
-    execute_process(COMMAND ${CMAKE_COMMAND} --build .
-                    RESULT_VARIABLE result
-                    ${OUTPUT_QUIET}
-                    WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
-    )
-    if(result)
-        message(FATAL_ERROR "Build step for ${DL_ARGS_PROJ} failed: ${result}")
-    endif()
-
-endfunction()

+ 1 - 1
cmake/ProtobufLookup.cmake

@@ -35,7 +35,7 @@ if(NOT Protobuf_FOUND)
         set(Protobuf_FOUND TRUE)
 #        message(STATUS "Found protobuf installation: ${Protobuf_PROTOC_EXECUTABLE} ${Protobuf_PROTOC_LIBRARY} ${Protobuf_LIBRARY}")
     else()
-        message(FATAL_ERROR "Protobuf is a hard dependency of the project. You may install it (with gRPC) by following instructions in cmake/gRPCBuild.cmake script.")
+        message(FATAL_ERROR "Protobuf is a hard dependency of the project")
         unset(Protobuf_LIBRARY)
         unset(Protobuf_PROTOC_EXECUTABLE)
         unset(Protobuf_PROTOC_LIBRARY)

+ 0 - 70
cmake/QtProtobufFunctions.cmake.in

@@ -1,70 +0,0 @@
-find_package(Protobuf)
-# TODO: replace with target_link_directories once released
-link_directories(@TARGET_LIB_DIR@)
-
-set(@TARGET@_INCLUDE_DIRS @TARGET_INCLUDE_DIR@)
-set(@TARGET@_LIBRARIES @PROTOBUF_LIBRARY_TARGET@)
-
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-function(generate_qtprotobuf)
-    set(options)
-    set(oneValueArgs OUT_DIR TARGET)
-    set(multiValueArgs GENERATED_HEADERS PROTO_FILES)
-    cmake_parse_arguments(generate_qtprotobuf "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
-    set(QtProtobuf_GENERATED ${generate_qtprotobuf_TARGET}_qtprotobuf_gen PARENT_SCOPE)
-    set(QtProtobuf_GENERATED ${generate_qtprotobuf_TARGET}_qtprotobuf_gen)
-
-    set(GEN_TARGET ${generate_qtprotobuf_TARGET}_qtprotobuf_generate)
-
-    add_custom_target(${GEN_TARGET})
-
-    if(NOT DEFINED QTPROTOBUF_EXECUTABLE)
-        set(QTPROTOBUF_EXECUTABLE @TARGET_BIN_DIR@/@GENERATOR_TARGET@)
-    endif()
-
-    foreach(PROTO_FILE IN LISTS generate_qtprotobuf_PROTO_FILES)
-        get_filename_component(BASE_DIR ${PROTO_FILE} DIRECTORY)
-        set(PROTO_INCLUDES -I"${BASE_DIR}" ${PROTO_INCUDES})
-    endforeach()
-
-    if(NOT DEFINED generate_qtprotobuf_OUT_DIR)
-        set(OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
-    else()
-        set(OUT_DIR ${generate_qtprotobuf_OUT_DIR})
-    endif()
-
-    file(MAKE_DIRECTORY ${OUT_DIR})
-
-    unset(QTPROTOBUF_GENERATED_SOURCES)
-    unset(QTPROTOBUF_GENERATED_HEADERS)
-    foreach(GENERATED_HEADER IN LISTS generate_qtprotobuf_GENERATED_HEADERS)
-        get_filename_component(GENERATED_BASENAME ${GENERATED_HEADER} NAME_WE)
-
-        list(APPEND QTPROTOBUF_GENERATED_SOURCES ${OUT_DIR}/${GENERATED_BASENAME}.cpp)
-        list(APPEND QTPROTOBUF_GENERATED_HEADERS ${OUT_DIR}/${GENERATED_BASENAME}.h)
-        set_property(SOURCE ${OUT_DIR}/${GENERATED_BASENAME}.cpp PROPERTY SKIP_AUTOMOC ON)
-    endforeach()
-
-    add_custom_command(TARGET ${GEN_TARGET}
-            COMMAND ${Protobuf_PROTOC_EXECUTABLE}
-                --@GENERATOR_TARGET@_opt=out=${OUT_DIR}
-                --plugin=protoc-gen-@GENERATOR_TARGET@=${QTPROTOBUF_EXECUTABLE}
-                --@GENERATOR_TARGET@_out=${OUT_DIR}
-                ${PROTO_INCLUDES}
-                ${PROTO_FILES}
-            WORKING_DIRECTORY ${OUT_DIR}
-            DEPENDS ${PROTO_FILES}
-            COMMENT "Generating test headers"
-    )
-
-    qt5_wrap_cpp(MOC_SOURCES ${QTPROTOBUF_GENERATED_HEADERS})
-    list(APPEND GENERATED_SOURCES ${MOC_SOURCES})
-
-    set_source_files_properties(${QTPROTOBUF_GENERATED_SOURCES} PROPERTIES GENERATED TRUE)
-    add_library(${QtProtobuf_GENERATED} ${QTPROTOBUF_GENERATED_SOURCES} ${MOC_SOURCES})
-    add_dependencies(${QtProtobuf_GENERATED} ${GEN_TARGET})
-    target_include_directories(${QtProtobuf_GENERATED} PRIVATE ${Qt5Core_INCLUDE_DIRS} ${Qt5Qml_INCLUDE_DIRS} ${QtProtobuf_INCLUDE_DIRS} ${QtGrpc_INCLUDE_DIRS} ${OUT_DIR})
-endfunction()

+ 0 - 136
cmake/gRPCBuild.cmake

@@ -1,136 +0,0 @@
-# This script clones gRPC project and builds it with its dependencies
-# In order to use it
-# - copy DownloadProject.cmake, DownloadProject.CMakeLists.cmake.in and current file
-#   into a separate folder outside the project.
-# - create there a simple CMakeLists.txt with content:
-# -------
-#   cmake_minimum_required(VERSION 3.1)
-#   project(gRPCTargetsBuilder)
-#   include(gRPCBuild.cmake)
-# -------
-#
-# -  from a build directory run "cmake <folder with created CMakeLists.txt>"
-#
-# In order to use the built gRPC project with qtprotobuf, please, specify CMAKE_PREFIX_PATH and other vars. E.g.
-# PATH="<build-grpc>/grpc/bin:$PATH" cmake -DCMAKE_PREFIX_PATH="<build-grpc>/protobuf/lib/cmake;<build-grpc>/grpc/lib/cmake" -Dprotobuf_MODULE_COMPATIBLE=ON <qtprotobuf_CMakeLists_dir>
-
-include(cmake/DownloadProject.cmake)
-download_project(PROJ   gRPCDownload
-                        GIT_REPOSITORY      https://github.com/grpc/grpc.git
-                        GIT_TAG             v1.20.x
-)
-set(gRPCDownload_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR})
-
-include(ExternalProject)
-# Builds c-ares project from the git submodule.
-# Note: For all external projects, instead of using checked-out code, one could
-# specify GIT_REPOSITORY and GIT_TAG to have cmake download the dependency directly,
-# without needing to add a submodule to your project.
-ExternalProject_Add(c-ares
-  PREFIX c-ares
-  SOURCE_DIR "${gRPCDownload_SOURCE_DIR}/third_party/cares/cares"
-  CMAKE_CACHE_ARGS
-        -DCARES_SHARED:BOOL=OFF
-        -DCARES_STATIC:BOOL=ON
-        -DCARES_STATIC_PIC:BOOL=ON
-        -DCMAKE_INSTALL_PREFIX:PATH=${gRPCDownload_INSTALL_DIR}/c-ares
-)
-
-# Builds protobuf project from the git submodule.
-ExternalProject_Add(protobuf
-  PREFIX protobuf
-  SOURCE_DIR "${gRPCDownload_SOURCE_DIR}/third_party/protobuf/cmake"
-  CMAKE_CACHE_ARGS
-        -Dprotobuf_BUILD_TESTS:BOOL=OFF
-        -Dprotobuf_WITH_ZLIB:BOOL=OFF
-        -Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF
-        -DCMAKE_INSTALL_PREFIX:PATH=${gRPCDownload_INSTALL_DIR}/protobuf
-)
-# Setup libprotobuf as a target
-set(LIBPROTOC_PREFIX_PATH "${gRPCDownload_INSTALL_DIR}/protobuf")
-set(LIBPROTOC_BINARY_PATH "${LIBPROTOC_PREFIX_PATH}/lib")
-set(LIBPROTOC_LIB_INCLUDE "${LIBPROTOC_PREFIX_PATH}/include")
-
-add_library(libprotoc IMPORTED STATIC GLOBAL)
-add_library(libprotobuf IMPORTED STATIC GLOBAL)
-add_executable(protoc IMPORTED GLOBAL)
-add_dependencies(libprotoc protobuf)
-add_dependencies(libprotobuf protobuf)
-add_dependencies(protoc protobuf)
-
-set_target_properties(protoc PROPERTIES
-        IMPORTED_LOCATION "${LIBPROTOC_PREFIX_PATH}/bin/protoc"
-)
-
-set_target_properties(libprotoc PROPERTIES
-        IMPORTED_LOCATION "${LIBPROTOC_BINARY_PATH}/libprotoc.a"
-        INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${LIBPROTOC_LIB_INCLUDE}>
-)
-
-set_target_properties(libprotobuf PROPERTIES
-        IMPORTED_LOCATION "${LIBPROTOC_BINARY_PATH}/libprotobuf.a"
-        INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${LIBPROTOC_LIB_INCLUDE}>
-)
-
-# Builds zlib project from the git submodule.
-ExternalProject_Add(zlib
-  PREFIX zlib
-  SOURCE_DIR "${gRPCDownload_SOURCE_DIR}/third_party/zlib"
-  CMAKE_CACHE_ARGS
-        -DCMAKE_INSTALL_PREFIX:PATH=${gRPCDownload_INSTALL_DIR}/zlib
-)
-
-# the location where protobuf-config.cmake will be installed varies by platform
-if (WIN32)
-  set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/cmake")
-else()
-  set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${gRPCDownload_INSTALL_DIR}/protobuf/lib/cmake/protobuf")
-endif()
-
-# if OPENSSL_ROOT_DIR is set, propagate that hint path to the external projects with OpenSSL dependency.
-set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "")
-if (OPENSSL_ROOT_DIR)
-  set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}")
-endif()
-
-# Builds gRPC based on locally checked-out sources and set arguments so that all the dependencies
-# are correctly located.
-ExternalProject_Add(gRPC
-  PREFIX grpc
-  SOURCE_DIR "${gRPCDownload_SOURCE_DIR}"
-  CMAKE_CACHE_ARGS
-        -DgRPC_INSTALL:BOOL=ON
-        -DgRPC_BUILD_TESTS:BOOL=OFF
-        -DgRPC_PROTOBUF_PROVIDER:STRING=package
-        -DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG
-        -DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR}
-        -DgRPC_ZLIB_PROVIDER:STRING=package
-        -DZLIB_ROOT:STRING=${gRPCDownload_INSTALL_DIR}/zlib
-        -DgRPC_CARES_PROVIDER:STRING=package
-        -Dc-ares_DIR:PATH=${gRPCDownload_INSTALL_DIR}/c-ares/lib/cmake/c-ares
-        -DgRPC_SSL_PROVIDER:STRING=package
-        ${_CMAKE_ARGS_OPENSSL_ROOT_DIR}
-        -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/grpc
-  DEPENDS c-ares protobuf zlib
-)
-set(LIBGRPC_PREFIX_PATH "${gRPCDownload_INSTALL_DIR}/grpc")
-
-add_executable(grpc_cpp_plugin IMPORTED GLOBAL)
-set_target_properties(grpc_cpp_plugin PROPERTIES
-        "IMPORTED_LOCATION" "${LIBGRPC_PREFIX_PATH}/bin/grpc_cpp_plugin"
-)
-
-add_library(grpc++ IMPORTED STATIC GLOBAL)
-set_target_properties(grpc++ PROPERTIES
-        IMPORTED_LOCATION "${LIBGRPC_PREFIX_PATH}/lib/libgrpc++.a"
-        INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${LIBGRPC_PREFIX_PATH}/include>
-        IMPORTED_LINK_INTERFACE_LIBRARIES "${LIBGRPC_PREFIX_PATH}/lib/libgrpc.a;${LIBGRPC_PREFIX_PATH}/lib/libgpr.a;${LIBGRPC_PREFIX_PATH}/lib/libaddress_sorting.a;${gRPCDownload_INSTALL_DIR}/c-ares/lib/libcares.a;${gRPCDownload_INSTALL_DIR}/zlib/lib/libz.a;ssl;crypto;pthread"
-)
-
-add_library(grpc IMPORTED STATIC GLOBAL)
-set_target_properties(grpc PROPERTIES
-        IMPORTED_LOCATION "${LIBGRPC_PREFIX_PATH}/lib/libgrpc.a"
-)
-add_dependencies(grpc_cpp_plugin gRPC)
-add_dependencies(grpc++ gRPC)
-add_dependencies(grpc gRPC)