summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/tools/probe-win.ps110
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pal/tools/probe-win.ps1 b/src/pal/tools/probe-win.ps1
index 3d6c969d06..fa30d9cb40 100644
--- a/src/pal/tools/probe-win.ps1
+++ b/src/pal/tools/probe-win.ps1
@@ -6,7 +6,7 @@ function GetCMakeVersions
$items = @()
$items += @(Get-ChildItem hklm:\SOFTWARE\Wow6432Node\Kitware -ErrorAction SilentlyContinue)
$items += @(Get-ChildItem hklm:\SOFTWARE\Kitware -ErrorAction SilentlyContinue)
- return $items | where { $_.PSChildName.StartsWith("CMake ") }
+ return $items | where { $_.PSChildName.StartsWith("CMake") }
}
function GetCMakeInfo($regKey)
@@ -17,7 +17,13 @@ function GetCMakeInfo($regKey)
catch {
return $null
}
- $cmakeDir = (Get-ItemProperty $regKey.PSPath).'(default)'
+ $itemProperty = Get-ItemProperty $regKey.PSPath;
+ if (Get-Member -inputobject $itemProperty -name "InstallDir" -Membertype Properties) {
+ $cmakeDir = $itemProperty.InstallDir
+ }
+ else {
+ $cmakeDir = $itemProperty.'(default)'
+ }
$cmakePath = [System.IO.Path]::Combine($cmakeDir, "bin\cmake.exe")
if (![System.IO.File]::Exists($cmakePath)) {
return $null