aboutsummaryrefslogtreecommitdiff
path: root/cmake/protoc.cmake
blob: bb160f479eb7ec928089973e0e1340ae44e0a631 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
set(protoc_files
  ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc
)

if (MSVC)
set(protoc_rc_files
  ${CMAKE_CURRENT_BINARY_DIR}/version.rc
)
endif()

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

set_target_properties(protoc PROPERTIES
    VERSION ${protobuf_VERSION})