Skip to content

[C++] Add CMake option ARROW_DEPENDENCY_SOURCE=VCPKG #27450

Closed

Description

@asfimport

ARROW-11340 enables the use of vcpkg to install Arrow C++ build dependencies, but we should consider making this more straightforward by adding a CMake option ARROW_DEPENDENCY_SOURCE=VCPKG.

Reporter: Ian Cook / @ianmcook
Assignee: Ian Cook / @ianmcook

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-11580. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Feb 18, 2021

    @asfimport
    Author

    Ian Cook / @ianmcook:
    Finding where vcpkg is installed and where it has installed packages is not as straightforward as with conda or brew.

    If you install vcpkg as per the docs, it does not add the vcpkg install directory to the path, and it does not set any environment variables that help you to find it. However when you run vcpkg integrate install, it creates a plain text file vcpkg.path.txt containing the path of the install directory. On Mac and Linux, this file is placed in $HOME/.vcpkg. On Windows, it's placed in %LOCALAPPDATA%\vcpkg. We should read this path from the file, confirm that the vcpkg executable exists in that path, and if so then set the variable VCPKG_ROOT to that path. Knowing this install path allows us to set the required CMake variable CMAKE_TOOLCHAIN_FILE.

    Another way for CMake to find VCPKG_ROOT should be for the user to set it as an environment variable. This will allow it to find vcpkg in cases where the user does not want to run vcpkg integrate install.

    vcpkg also puts some other files in the directory at $HOME/.vcpkg or %LOCALAPPDATA%\vcpkg, but the details of those other files are poorly documented and it seems necessary to read the vcpkg source code in https://github.com/microsoft/vcpkg-tool to figure out what they are for.

  2. asfimport commented on Feb 18, 2021

    @asfimport
    Author

    Ian Cook / @ianmcook:
    To find where vcpkg has installed packages:

    • First look in $ARROW_SOURCE_DIR/vcpkg_installed 

    • If not found there, look in $VCPKG_ROOT/installed

      Within that installed directory, there will be a triplet subdirectory. If the environment variable CMake option VCPKG_DEFAULT_TRIPLET is set, then look for a subdirectory of the installed directory with that name. If that exists, set that name to the triplet. If it does not exist, error. If that env var/CMake option is not set, then assert that there is one and only one subdirectory within the installed directory that is not named vcpkg, and if so, set the triplet to the name of that subdirectory. Set the value of the CMake variable VCPKG_TARGET_TRIPLET to this triplet, and set the value of the CMake variable _VCPKG_INSTALLED_DIR to the installed directory path.

      If VCPKG_MANIFEST_MODE is OFF, then do not look for packages in $ARROW_SOURCE_DIR/vcpkg_installed .

      Set the value of the CMake variable ARROW_PACKAGE_PREFIX to _VCPKG_INSTALLED_DIR/``VCPKG_TARGET_TRIPLET.

  3. asfimport commented on Mar 5, 2021

    @asfimport
    Author

    Kouhei Sutou / @kou:
    Issue resolved by pull request 9553
    #9553

  4. added this to the 4.0.0 milestone on Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions