protoc.cmake 394 B

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