diff options
author | Petr Hosek <phosek@google.com> | 2022-05-26 19:54:57 +0300 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-05-26 19:55:35 +0300 |
commit | 368db7123bf3178c92c8502696c6865fb07bfcda (patch) | |
tree | c49bf1c4fea21dc58ca6f45dd040c451c9cef41e | |
parent | cd19e0e1b0fd24cd3d785beff1b50583e572dae0 (diff) |
Define namespace prefixed aliases for targets in the CMake build
This allows projects that depend on ruy to use namespace qualified
target names regardless of whether they consume ruy through
add_subdirectory or find_package.
Closes https://github.com/google/ruy/pull/311
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ruy/pull/311 from petrhosek:cmake-alias c00fae2a56a567b216dea0b0fe7378c28ddadbbf
PiperOrigin-RevId: 451184466
-rw-r--r-- | cmake/ruy_cc_library.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/ruy_cc_library.cmake b/cmake/ruy_cc_library.cmake index 999842f..3f3a062 100644 --- a/cmake/ruy_cc_library.cmake +++ b/cmake/ruy_cc_library.cmake @@ -83,6 +83,8 @@ function(ruy_cc_library) ) endif() + add_library(${PROJECT_NAME}::${_NAME} ALIAS ${_NAME}) + if(NOT _RULE_TESTONLY) install( TARGETS ${_NAME} |