From fb9f24eaee4c57d09ec0dca32abff840b39f7c7e Mon Sep 17 00:00:00 2001 From: Gil Date: Fri, 13 Jul 2018 11:09:44 -0700 Subject: Convert googletest and nanopb CMake builds to add_subdirectory (#1522) * Add a download-only boringssl ExternalProject Match boringssl version to grpc submodule version Note: not yet in use * Split grpc into separate download and build tasks This allows other external targets to download into the gRPC source tree before grpc is actually built. * Convert grpc to an http download * Build googletest with add_subdirectory Also: * Revert library-name modifications in the abseil-cpp build * Move abseil-cpp add_subdirectory build into place * Build nanopb with add_subdirectory * Force nanopb first to work around ODR violations This is a temporary work-around for b/111328563. --- cmake/utils.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmake/utils.cmake') diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 1c3cbd6..7d32624 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -89,3 +89,15 @@ function(add_objc_flags target) ) endif() endfunction() + +# add_alias(alias_target actual_target) +# +# Adds a library alias target `alias_target` if it does not already exist, +# aliasing to the given `actual_target` target. This allows library dependencies +# to be specified uniformly in terms of the targets found in various +# find_package modules even if the library is being built internally. +function(add_alias ALIAS_TARGET ACTUAL_TARGET) + if(NOT TARGET ${ALIAS_TARGET}) + add_library(${ALIAS_TARGET} ALIAS ${ACTUAL_TARGET}) + endif() +endfunction() -- cgit v1.2.3