Skip to content

Commit fd9c326

Browse files
author
sourcehold
committed
[BUILD] add support for finding cmake in Microsoft.VisualStudio.Product.BuildTools environments
1 parent 5f088dd commit fd9c326

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

build.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@ if errorlevel 1 (
2424
FOR /F "tokens=* USEBACKQ" %%g IN (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath -requires Microsoft.VisualStudio.Component.VC.CMake.Project`) do (
2525
SET "CMAKE=%%g\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
2626
)
27-
echo [INFO] Detected: "!CMAKE!"
27+
if not exist "!CMAKE!" (
28+
FOR /F "tokens=* USEBACKQ" %%g IN (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath -requires Microsoft.VisualStudio.Component.VC.CMake.Project -products Microsoft.VisualStudio.Product.BuildTools` ) do (
29+
SET "CMAKE=%%g\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
30+
)
31+
)
2832
if not exist "!CMAKE!" (
2933
echo [ERROR] 'cmake' is not found in PATH and not found using vswhere.
3034
exit /b 1
3135
)
36+
echo [INFO] Detected: "!CMAKE!"
3237
set "PATH=!CMAKE!;%PATH%"
3338
)
3439

0 commit comments

Comments
 (0)