FindUnixCommands.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. FindUnixCommands
  5. ----------------
  6. Find Unix commands, including the ones from Cygwin
  7. This module looks for the Unix commands ``bash``, ``cp``, ``gzip``,
  8. ``mv``, ``rm``, and ``tar`` and stores the result in the variables
  9. ``BASH``, ``CP``, ``GZIP``, ``MV``, ``RM``, and ``TAR``.
  10. #]=======================================================================]
  11. include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
  12. find_program(BASH
  13. bash
  14. ${CYGWIN_INSTALL_PATH}/bin
  15. )
  16. mark_as_advanced(
  17. BASH
  18. )
  19. find_program(CP
  20. cp
  21. ${CYGWIN_INSTALL_PATH}/bin
  22. )
  23. mark_as_advanced(
  24. CP
  25. )
  26. find_program(GZIP
  27. gzip
  28. ${CYGWIN_INSTALL_PATH}/bin
  29. )
  30. mark_as_advanced(
  31. GZIP
  32. )
  33. find_program(MV
  34. mv
  35. ${CYGWIN_INSTALL_PATH}/bin
  36. )
  37. mark_as_advanced(
  38. MV
  39. )
  40. find_program(RM
  41. rm
  42. ${CYGWIN_INSTALL_PATH}/bin
  43. )
  44. mark_as_advanced(
  45. RM
  46. )
  47. find_program(TAR
  48. NAMES
  49. tar
  50. gtar
  51. PATH
  52. ${CYGWIN_INSTALL_PATH}/bin
  53. )
  54. mark_as_advanced(
  55. TAR
  56. )
  57. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  58. find_package_handle_standard_args(UnixCommands
  59. REQUIRED_VARS BASH CP GZIP MV RM TAR
  60. )