# FindMsys

Added in version 3.21.

Finds MSYS, a POSIX-compatible environment that runs natively on Microsoft Windows:

    find_package(Msys [...])

Note

This module is primarily intended for use in other Find Modules to help locate programs when using the `find_*()` commands, such as `find_program()`. In most cases, direct use of those commands is sufficient. Use this module only if a specific program is known to be installed via MSYS and is usable from Windows.

## Result Variables

This module defines the following variables:

`Msys_FOUND`

  Added in version 4.2.

  Boolean indicating whether MSYS was found.

`MSYS_INSTALL_PATH`

  The path to the MSYS root installation directory.

## Examples

Finding the MSYS installation and using its path in a custom find module:

`FindFoo.cmake`

    find_package(Msys)
    find_program(Foo_EXECUTABLE NAMES foo PATHS ${MSYS_INSTALL_PATH}/usr/bin)

    include(FindPackageHandleStandardArgs)
    find_package_handle_standard_args(Foo REQUIRED_VARS Foo_EXECUTABLE)

## See Also

- The `FindCygwin` module to find Cygwin path in a similar way.