diff options
author | Orgad Shaneh <orgads@gmail.com> | 2021-04-28 11:18:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-04-28 14:41:17 (GMT) |
commit | 990b370401a26e43ddc3371ec056c6a8e2adfaec (patch) | |
tree | 95f52387ca611b804bc4efe1f5d9a50552dde3c5 /Modules/FindMsys.cmake | |
parent | 91788612450ca2d2fecda2c0f6ca9a323d0a8617 (diff) | |
download | CMake-990b370401a26e43ddc3371ec056c6a8e2adfaec.zip CMake-990b370401a26e43ddc3371ec056c6a8e2adfaec.tar.gz CMake-990b370401a26e43ddc3371ec056c6a8e2adfaec.tar.bz2 |
FindMsys: Add a module to find MSYS and some bundled packages
Diffstat (limited to 'Modules/FindMsys.cmake')
-rw-r--r-- | Modules/FindMsys.cmake | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Modules/FindMsys.cmake b/Modules/FindMsys.cmake new file mode 100644 index 0000000..b4796d2 --- /dev/null +++ b/Modules/FindMsys.cmake @@ -0,0 +1,31 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindMsys +-------- + +.. versionadded:: 3.21 + +Find MSYS, a POSIX-compatible environment that runs natively +on Microsoft Windows +#]=======================================================================] + +if (WIN32) + if(MSYS_INSTALL_PATH) + set(MSYS_CMD "${MSYS_INSTALL_PATH}/msys2_shell.cmd") + endif() + + find_program(MSYS_CMD + NAMES msys2_shell.cmd + PATHS + "C:/msys64" + "C:/msys32" + "C:/MSYS" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MSYS\\setup;rootdir]" + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\MSYS\\mounts v2\\/;native]" + ) + get_filename_component(MSYS_INSTALL_PATH "${MSYS_CMD}" DIRECTORY) + mark_as_advanced(MSYS_CMD) + +endif () |