-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Bug Report
Is the issue related to model conversion?
This is not related to model conversion.
Describe the bug
When building ONNX with CMake, and building the install target, the v1.19.0 output included a dependency on protobuf targets, but the v1.20.0 output does not. As a result consuming ONNX from the install interface fails with unresolved externals in protobuf.
As an example, the v1.19.0 builds 'ONNXTargets.cmake' says:
# Create imported target ONNX::onnx_proto
add_library(ONNX::onnx_proto STATIC IMPORTED)
set_target_properties(ONNX::onnx_proto PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "ONNX_NAMESPACE=onnx;ONNX_ML=1"
INTERFACE_COMPILE_OPTIONS "/wd4146;/wd4244;/wd4267;/wd4141"
INTERFACE_LINK_LIBRARIES "protobuf::libprotobuf"
)Note the protobuf::libprotobuf entry. In the v1.20.0 output, there's no mention of protobuf::libprotobuf. The ONNX::onnx_proto target is just:
# Create imported target ONNX::onnx_proto
add_library(ONNX::onnx_proto STATIC IMPORTED)
set_target_properties(ONNX::onnx_proto PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "ONNX_ML=1;ONNX_NAMESPACE=onnx"
)This appears to be a regression introduced by #7087.
System information
- CMake v4.2.0
- ONNX @ tag v1.20.0
Reproduction instructions
Use cmake to confiugure, build and install ONNX. The generated 'ONNXTargets.cmake' does not announce a needed Protobuf dependency.
Expected behavior
The generated 'ONNXTargets.cmake' does announce a needed Protobuf dependency.