This is an automated email from the ASF dual-hosted git repository. kou pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push: new 9013abc71e GH-47491: [C++] Don't set include directories to found targets (#47492) 9013abc71e is described below commit 9013abc71e6f200f1c46f745940fa1fcd85a8bd6 Author: Sutou Kouhei <k...@clear-code.com> AuthorDate: Fri Sep 5 14:25:18 2025 +0900 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 <k...@clear-code.com> Signed-off-by: Sutou Kouhei <k...@clear-code.com> --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index acd7f42a06..79700aea04 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -4651,8 +4651,10 @@ function(build_orc) get_filename_component(Protobuf_ROOT "${PROTOBUF_INCLUDE_DIR}" DIRECTORY) set(PROTOBUF_HOME ${Protobuf_ROOT}) # ORC uses this. - target_include_directories(${ARROW_PROTOBUF_LIBPROTOC} - INTERFACE "${PROTOBUF_INCLUDE_DIR}") + if(PROTOBUF_VENDORED) + target_include_directories(${ARROW_PROTOBUF_LIBPROTOC} + INTERFACE "${PROTOBUF_INCLUDE_DIR}") + endif() set(PROTOBUF_EXECUTABLE ${ARROW_PROTOBUF_PROTOC}) set(PROTOBUF_LIBRARY ${ARROW_PROTOBUF_LIBPROTOBUF}) set(PROTOC_LIBRARY ${ARROW_PROTOBUF_LIBPROTOC})