1set(protoc_files 2 ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc 3) 4 5if (MSVC) 6set(protoc_rc_files 7 ${CMAKE_CURRENT_BINARY_DIR}/version.rc 8) 9endif() 10 11add_executable(protoc ${protoc_files} ${protoc_rc_files}) 12target_link_libraries(protoc libprotoc libprotobuf) 13add_executable(protobuf::protoc ALIAS protoc) 14 15set_target_properties(protoc PROPERTIES 16 VERSION ${protobuf_VERSION}) 17