diff options
author | Brad King <brad.king@kitware.com> | 2017-08-16 14:47:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-16 14:47:38 (GMT) |
commit | b034e22f3605583d3ff22b5ccfb6b59bfc8b1500 (patch) | |
tree | 2f6ac2d1fe68ee854aa7259d518f515b6352cedd /Modules | |
parent | 867b0611539de7204521205df59947d7abfc2ed4 (diff) | |
parent | a428b87ccfa5fe186246f7faef42db11ba85fa74 (diff) | |
download | CMake-b034e22f3605583d3ff22b5ccfb6b59bfc8b1500.zip CMake-b034e22f3605583d3ff22b5ccfb6b59bfc8b1500.tar.gz CMake-b034e22f3605583d3ff22b5ccfb6b59bfc8b1500.tar.bz2 |
Merge topic 'FindCygwin-fix-regression'
a428b87c Merge branch 'backport-FindCygwin-fix-regression' into FindCygwin-fix-regression
62930253 FindCygwin: Fix regression when CYGWIN_INSTALL_PATH is already set
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1128
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCygwin.cmake | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake index 086c7dc..092a3bd 100644 --- a/Modules/FindCygwin.cmake +++ b/Modules/FindCygwin.cmake @@ -8,7 +8,11 @@ # this module looks for Cygwin if (WIN32) - find_program(CYGWIN_INSTALL_PATH + if(CYGWIN_INSTALL_PATH) + set(CYGWIN_BAT "${CYGWIN_INSTALL_PATH}/cygwin.bat") + endif() + + find_program(CYGWIN_BAT NAMES cygwin.bat PATHS "C:/Cygwin" @@ -16,8 +20,7 @@ if (WIN32) "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygwin\\setup;rootdir]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/;native]" ) - get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_INSTALL_PATH}" DIRECTORY) - mark_as_advanced( - CYGWIN_INSTALL_PATH - ) + get_filename_component(CYGWIN_INSTALL_PATH "${CYGWIN_BAT}" DIRECTORY) + mark_as_advanced(CYGWIN_BAT) + endif () |