| 1 |
set(protoc_files |
| 2 |
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/main.cc |
| 3 |
) |
| 4 |
|
| 5 |
add_executable(protoc ${protoc_files} ${protobuf_version_rc_file}) |
| 6 |
target_link_libraries(protoc |
| 7 |
libprotoc |
| 8 |
libprotobuf |
| 9 |
${protobuf_ABSL_USED_TARGETS} |
| 10 |
) |
| 11 |
add_executable(protobuf::protoc ALIAS protoc) |
| 12 |
|
| 13 |
set_target_properties(protoc PROPERTIES |
| 14 |
VERSION ${protobuf_VERSION}) |
| 15 |
|
| 16 |
################################################################ |
| 17 |
|
| 18 |
IF(APPLE) |
| 19 |
TARGET_LINK_OPTIONS(protoc PRIVATE LINKER:-no_warn_duplicate_libraries) |
| 20 |
ENDIF() |
| 21 |
|
| 22 |
SET_TARGET_PROPERTIES(protoc PROPERTIES |
| 23 |
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/runtime_output_directory) |
| 24 |
|
| 25 |
ADD_OBJDUMP_TARGET(show_protoc "$<TARGET_FILE:protoc>" DEPENDS protoc) |
| 26 |
|
| 27 |
# The target symlink_protobuf_dlls will take care of the required |
| 28 |
# symbolic links to make protobuf(-lite) library accessible to all |
| 29 |
# kind of modules: binaries, plugins, including its debug builds. |
| 30 |
# All targets which link with protobuf(-lite) depend on this target. |
| 31 |
# This target will also work when building individual components, |
| 32 |
# like router. |
| 33 |
IF(TARGET symlink_protobuf_dlls) |
| 34 |
ADD_DEPENDENCIES(protoc symlink_protobuf_dlls) |
| 35 |
ENDIF() |