aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/utils.cmake
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-07-13 11:09:44 -0700
committerGravatar GitHub <noreply@github.com>2018-07-13 11:09:44 -0700
commitfb9f24eaee4c57d09ec0dca32abff840b39f7c7e (patch)
tree95bde20bd905b2a2647ff60c09435526070cac9a /cmake/utils.cmake
parent855a7665aef505db456aa1c6f1cb9ea2b68056da (diff)
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.
Diffstat (limited to 'cmake/utils.cmake')
-rw-r--r--cmake/utils.cmake12
1 files changed, 12 insertions, 0 deletions
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()