Skip to content

[C++] CMake Windows Install - Wrong Config File Locations #49090

@WillAyd

Description

@WillAyd

Describe the bug, including details regarding any error messages, version, and platform.

The way CMake installs Arrow on Windows does not follow CMake's requirements for subsequently finding config files. The consequence of this is that the default find_package() calls from third parties will fail to find arrow libraries correctly.

The CMake Docs list the patterns by which find_package will discover files like ArrowConfig.cmake and ArrowComputeConfig.cmake. Some patterns are Windows-only, some are Unix-only. The cross-platform search paths are:

<prefix>/<name>*/(lib/<arch>\|lib*\|share)/cmake/<name>*/ 
<prefix>/<name>*/(lib/<arch>\|lib*\|share)/<name>*/ 
<prefix>/<name>*/(lib/<arch>\|lib*\|share)/<name>*/(cmake\|CMake)/

When the CMAKE_INSTALL_PREFIX is not overriden, Arrow installs configs for the main library and compute to:

C:/Program Files/arrow/lib/cmake/Arrow/ArrowConfig.cmake
C:/Program Files/arrow/lib/cmake/ArrowCompute/ArrowComputeConfig.cmake

Ignoring case, this allows find_package(Arrow) to work because that matches the <prefix>/<name>*/(lib/<arch>\|lib*\|share)/cmake/<name>*/ convention; however, find_package(ArrowCompute) fails.

If you specify a INSTALL_PREFIX like C:\arrow-dist, you end up with:

C:/arrow-dist/lib/cmake/Arrow/ArrowConfig.cmake
C:/arrow-dist/lib/cmake/ArrowCompute/ArrowComputeConfig.cmake

In this case, neither config file can be found by find_package, assumedly because CMake expects the name to appear after the <prefix>

This was discovered in my fork of Arrow with the help of @raulcd

Component(s)

C++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions