summaryrefslogtreecommitdiff
path: root/src/pal/tools
diff options
context:
space:
mode:
authorLuis G <lggomez@users.noreply.github.com>2017-03-23 02:51:45 -0300
committerDan Moseley <danmose@microsoft.com>2017-03-22 22:51:45 -0700
commit6c73fd9440a68f064f4767347a4401155ee88899 (patch)
tree4472c361817aad2fb828d459683907c616a87fa0 /src/pal/tools
parent72c57d9d9fd2d4cd8c96f124d132d316c8ef6013 (diff)
downloadcoreclr-6c73fd9440a68f064f4767347a4401155ee88899.tar.gz
coreclr-6c73fd9440a68f064f4767347a4401155ee88899.tar.bz2
coreclr-6c73fd9440a68f064f4767347a4401155ee88899.zip
Add handling of multiple CMake installations in probe-win (#9980)
* Add handling of multiple CMake installations in probe-win Check if multiple CMake versions are installed, and use by default the first path available Fixes #8221 * Fix typo in value accessor * Restore previous null check in probe_win * Remove redundant assignment
Diffstat (limited to 'src/pal/tools')
-rw-r--r--src/pal/tools/probe-win.ps18
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 = @()