Haibo Huang | d00577c | 2020-02-28 16:35:48 -0800 | [diff] [blame] | 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
| 2 | # file Copyright.txt or https://cmake.org/licensing for details. |
| 3 | |
| 4 | #[=======================================================================[.rst: |
| 5 | FindCygwin |
| 6 | ---------- |
| 7 | |
| 8 | Find Cygwin, a POSIX-compatible environment that runs natively |
| 9 | on Microsoft Windows |
| 10 | #]=======================================================================] |
| 11 | |
| 12 | if (WIN32) |
| 13 | if(CYGWIN_INSTALL_PATH) |
| 14 | set(CYGWIN_BAT "${CYGWIN_INSTALL_PATH}/cygwin.bat") |
| 15 | endif() |
| 16 | |
| 17 | find_program(CYGWIN_BAT |
| 18 | NAMES cygwin.bat |
| 19 | PATHS |
| 20 | "C:/Cygwin" |
| 21 | "C:/Cygwin64" |
| 22 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]" |
| 23 | "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]" |
| 24 | ) |
| 25 | get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_BAT}" DIRECTORY) |
| 26 | mark_as_advanced(CYGWIN_BAT) |
| 27 | |
| 28 | endif () |