From f7a05844eb39daaf057c4048e7acbe40a1c7e0da Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 29 Jan 2018 15:13:23 +0100 Subject: Add CMake ALIAS targets We follow the findProtobuf.cmake naming convention to ease the use of protobuf as cmake subproject --- cmake/libprotobuf-lite.cmake | 1 + cmake/libprotobuf.cmake | 1 + cmake/libprotoc.cmake | 1 + cmake/protoc.cmake | 1 + 4 files changed, 4 insertions(+) diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 423b6c17..2df6a293 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -65,3 +65,4 @@ set_target_properties(libprotobuf-lite PROPERTIES VERSION ${protobuf_VERSION} OUTPUT_NAME ${LIB_PREFIX}protobuf-lite DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") +add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite) diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index e07340d2..65d05c19 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -128,3 +128,4 @@ set_target_properties(libprotobuf PROPERTIES VERSION ${protobuf_VERSION} OUTPUT_NAME ${LIB_PREFIX}protobuf DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") +add_library(protobuf::libprotobuf ALIAS libprotobuf) diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index a85dccdf..5f6d078c 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -228,3 +228,4 @@ set_target_properties(libprotoc PROPERTIES VERSION ${protobuf_VERSION} OUTPUT_NAME ${LIB_PREFIX}protoc DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}") +add_library(protobuf::libprotoc ALIAS libprotoc) diff --git a/cmake/protoc.cmake b/cmake/protoc.cmake index 4f07c389..5777b16e 100644 --- a/cmake/protoc.cmake +++ b/cmake/protoc.cmake @@ -4,3 +4,4 @@ set(protoc_files add_executable(protoc ${protoc_files}) target_link_libraries(protoc libprotobuf libprotoc) +add_executable(protobuf::protoc ALIAS protoc) -- cgit v1.2.3