8
9

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 5 years have passed since last update.

MacOSXでcmakeのコマンドライン版を使えるようにする

Posted at

本来は

sudo "/Applications/CMake X.X-X.app/Contents/MacOS/Cmake X.X-X"
(Xはバージョン番号)

と管理者権限でcmake GUI版を立ち上げ、メニューのtools->Install for Command Line Useを選択するだけでターミナルからcmakeできるようになる。

が、2.8時代にこれが失敗してしまうことがあった。(今はどうか知らない)
“Install for Command Line Use”はlnコマンドでCMakeパッケージ内の各コマンドを/usr/bin以下にシンボルリンクを張っているだけなので、自力でやってしまえばいい。

sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/ccmake" /usr/bin/ccmake
sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/cmake" /usr/bin/cmake
sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/cmake-gui" /usr/bin/cmake-gui
sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/cmakexbuild" /usr/bin/cmakexbuild
sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/cpack" /usr/bin/cpack
sudo ln -s "/Applications/CMake X.X-X.app/Contents/bin/ctest" /usr/bin/ctest

8
9
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
8
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?