Skip to content

GH-53995: [C++] Fix FetchContent build failure on CMake < 3.30 - #54457

Open
pratikdeoke wants to merge 1 commit into
apache:mainfrom
pratikdeoke:fix/fetchcontent-cmake-source-dir
Open

pratikdeoke wants to merge 1 commit into
apache:mainfrom
pratikdeoke:fix/fetchcontent-cmake-source-dir

Conversation

@pratikdeoke

@pratikdeoke pratikdeoke commented Oct 18, 2026 •

Copy link
Copy Markdown

Rationale for this change

When building Arrow via CMake's FetchContent on versions older than 3.30,
the variable arrow_SOURCE_DIR (lowercase) gets overridden by FetchContent
because project(arrow) sets it as a cache variable while FetchContent sets
a normal variable with higher precedence. This causes Arrow to fail finding
thirdparty/versions.txt.

What changes are included in this PR?

Replace arrow_SOURCE_DIR with ARROW_SOURCE_DIR in
cpp/cmake_modules/ThirdpartyToolchain.cmake so that Arrow does not rely
on the lowercase variable that conflicts with FetchContent on older CMake.

Are these changes tested?

The fix was verified via the workaround patch applied in
apache/iceberg-cpp#1029, which applies the same change and confirmed it
resolves the issue on CMake 3.28.3.

Fixes: #53995

Copilot AI balanced review requested due to automatic review settings October 18, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #53995 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++] Building Arrow via FetchContent can fail with versions older than CMake 3.30

2 participants