From b3488242f8031db83121cf883ceb4b3547582e3d Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Sun, 12 Oct 2014 16:56:43 -0700 Subject: [PATCH] Check if CMake is accessible before trying to invoke it. The default option in CMake's installer is to not install itself into the path. Our directions on http://h-uru.github.io/Plasma/ remind the user to select the correct option, but they may overlook this, and be faced with an error running this script. Adding a specific message here during this case will help guide them to self-fixing the problem. --- prepare_env.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/prepare_env.ps1 b/prepare_env.ps1 index 31d515af..d2becbc6 100644 --- a/prepare_env.ps1 +++ b/prepare_env.ps1 @@ -26,8 +26,13 @@ if (!(Test-Path -PathType Container devlibs)) { Write-Host "OK" -foregroundColor Green } -Write-Host "Running CMake to configure build system... " -cmake -DCMAKE_INSTALL_PREFIX=devlibs -DPLASMA_BUILD_TOOLS=OFF -DPLASMA_BUILD_RESOURCE_DAT=OFF -G "Visual Studio 12" .. +if(Get-ChildItem Env:PATH | Where-Object {$_.Value -match "CMake"}) { + Write-Host "Running CMake to configure build system... " + cmake -DCMAKE_INSTALL_PREFIX=devlibs -DPLASMA_BUILD_TOOLS=OFF -DPLASMA_BUILD_RESOURCE_DAT=OFF -G "Visual Studio 12" .. +} else { + Write-Host "CMake not found in PATH." + Write-Host "Please run the CMake installer and select the option to add CMake to your system PATH." +} if ($Host.Name -eq "ConsoleHost") { Write-Host ""