FindCygwin.cmake 870 B

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