Skip to content

Commit

Permalink
Add CMake ALIAS targets
Browse files Browse the repository at this point in the history
We follow the findProtobuf.cmake naming convention
to ease the use of protobuf as cmake subproject
  • Loading branch information
Mizux committed Feb 1, 2018
1 parent 3bc0282 commit f7a0584
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/libprotobuf-lite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions cmake/libprotobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions cmake/libprotoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions cmake/protoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ set(protoc_files

add_executable(protoc ${protoc_files})
target_link_libraries(protoc libprotobuf libprotoc)
add_executable(protobuf::protoc ALIAS protoc)

0 comments on commit f7a0584

Please sign in to comment.