Last active
May 1, 2022 08:14
-
-
Save n-suudai/ebcfacc455d48d863c7585d225ca818a to your computer and use it in GitHub Desktop.
CMakeインストールの自動化サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set CURRENT_DIR=%~dp0 | |
pushd %CURRENT_DIR% | |
set TARGET_DIR=%CURRENT_DIR% | |
set CMAKE_VERSION=3.23.1 | |
set CMAKE_ARCHIVE_NAME=cmake-%CMAKE_VERSION%-windows-x86_64 | |
set CMAKE_PATH=%TARGET_DIR%\%CMAKE_ARCHIVE_NAME%\bin | |
@rem CMakeインストール確認 | |
if exist %CMAKE_PATH% ( | |
goto :CMAKE_INSTALLED | |
) | |
@rem zipダウンロード | |
bitsadmin /RawReturn /TRANSFER getfile ^ | |
https://github.com/Kitware/CMake/releases/download/v%CMAKE_VERSION%/%CMAKE_ARCHIVE_NAME%.zip ^ | |
%TARGET_DIR%\%CMAKE_ARCHIVE_NAME%.zip | |
@rem zip展開 | |
powershell Expand-Archive -Path %CMAKE_ARCHIVE_NAME%.zip -DestinationPath %TARGET_DIR% | |
@rem zip削除 | |
del %CMAKE_ARCHIVE_NAME%.zip | |
@rem バージョン確認 | |
:CMAKE_INSTALLED | |
%CMAKE_PATH%\cmake.exe --version | |
popd | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment