vcpkg/docs/maintainers/vcpkg_acquire_msys.md
Robert Schumacher 2c9ee072da [vcpkg_build_cmake] Refactor _build_ and _install_ into a single cmake script.
Regenerate documentation. Remove MSVC_64_TOOLSET option because it's obsolete.
2017-10-05 17:49:28 -07:00

1.4 KiB

vcpkg_acquire_msys

Download and prepare an MSYS2 instance.

Usage

vcpkg_acquire_msys(<MSYS_ROOT_VAR>)

Parameters

MSYS_ROOT_VAR

An out-variable that will be set to the path to MSYS2.

Notes

A call to vcpkg_acquire_msys will usually be followed by a call to bash.exe:

vcpkg_acquire_msys(MSYS_ROOT)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)

vcpkg_execute_required_process(
    COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh"
    WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
    LOGNAME build-${TARGET_TRIPLET}-rel
)

To ensure a package is available:

vcpkg_acquire_msys(MSYS_ROOT)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)

message(STATUS "Installing MSYS Packages")
vcpkg_execute_required_process(
    COMMAND
        ${BASH} --noprofile --norc -c
            'PATH=/usr/bin:\$PATH pacman -Sy --noconfirm --needed make'
    WORKING_DIRECTORY ${MSYS_ROOT}
    LOGNAME pacman-${TARGET_TRIPLET})

Examples

Source

scripts/cmake/vcpkg_acquire_msys.cmake