0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WindowsでCMakeを使う(MinGW, without VS)

Last updated at Posted at 2023-12-16

はじめに

WSL等, Linuxが使えて, そちらで代用できる場合はLinuxの方がよいかも

この記事は2023年12月時点での操作です. 情報が古くなっている可能性があります.

インストール

  1. MSYS2の公式ページからインストーラをダウンロード
  2. 指示された手順通りにインストールを進めます
  3. 8, Now you can call gcc to build software for Windows.まで出来たら一度 Windowsを再起動しておきます.
  4. MSYS2 MINGW64を起動します. (アプリ一覧のMSYS2フォルダの中にあります)
  5. 以下のコマンドを順に実行します.
pacman -Suy

インストール済みのパッケージ群をアップデートします.
ターミナルが閉じられることもあります.

pacman -S --needed mingw-w64-ucrt-x86_64-toolchain

このコマンドを実行すると次のような選択を求められます
スクリーンショット 2023-12-16 133404.png
C言語のプロジェクトで, CMakeを使う場合は 8番と15番をインストールします

VSCodeのページを見ると全てインストールしていたりするので好みの問題でもあります.
8,15の場合は500Mib弱, 全てインストールすると1000MiB強です.

2024/01/03追記
番号ずれてます

pacman -S mingw-w64-x86_64-cmake

cmakeをインストールします.

使ってみる

プロジェクトのディレクトリで, 次を実行します. (大前提ですが, build/ の中に入っています)

cmake .. -G "MSYS Makefiles"

おわりに

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?