Skip to content

Commit 9013abc

Browse files
authored
GH-47491: [C++] Don't set include directories to found targets (#47492)
### Rationale for this change We can't set include directories to targets that aren't created by our CMake configuration. ### What changes are included in this PR? Set include directories to libprotoc target only when we use bundled Protobuf. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. * GitHub Issue: #47491 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 556c239 commit 9013abc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,8 +4651,10 @@ function(build_orc)
46514651
get_filename_component(Protobuf_ROOT "${PROTOBUF_INCLUDE_DIR}" DIRECTORY)
46524652
set(PROTOBUF_HOME ${Protobuf_ROOT})
46534653
# ORC uses this.
4654-
target_include_directories(${ARROW_PROTOBUF_LIBPROTOC}
4655-
INTERFACE "${PROTOBUF_INCLUDE_DIR}")
4654+
if(PROTOBUF_VENDORED)
4655+
target_include_directories(${ARROW_PROTOBUF_LIBPROTOC}
4656+
INTERFACE "${PROTOBUF_INCLUDE_DIR}")
4657+
endif()
46564658
set(PROTOBUF_EXECUTABLE ${ARROW_PROTOBUF_PROTOC})
46574659
set(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF})
46584660
set(PROTOC_LIBRARY ${ARROW_PROTOBUF_LIBPROTOC})

0 commit comments

Comments
 (0)