diff options
Diffstat (limited to 'src/pal/tools/probe-win.ps1')
-rw-r--r-- | src/pal/tools/probe-win.ps1 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pal/tools/probe-win.ps1 b/src/pal/tools/probe-win.ps1 index 783cb6dfe0..3d6c969d06 100644 --- a/src/pal/tools/probe-win.ps1 +++ b/src/pal/tools/probe-win.ps1 @@ -28,9 +28,13 @@ function GetCMakeInfo($regKey) function LocateCMake { $errorMsg = "CMake is a pre-requisite to build this repository but it was not found on the path. Please install CMake from http://www.cmake.org/download/ and ensure it is on your path." - $inPathPath = (get-command cmake.exe -ErrorAction SilentlyContinue).Path + $inPathPath = (get-command cmake.exe -ErrorAction SilentlyContinue) if ($inPathPath -ne $null) { - return $inPathPath + # Resolve the first version of CMake if multiple commands are found + if ($inPathPath.Length -gt 1) { + return $inPathPath[0].Path + } + return $inPathPath.Path } # Let us hope that CMake keep using their current version scheme $validVersions = @() |