Macでcmakeのアップデートをしたい
Macでcmakeのアップデートをしたいが、できない。
Mac(Big Sur11.7)でbrewでcmakeのアップデートがうまくできません。
現在、下記ページを見ながらESP-IDFのサンプルプログラムの実行環境を整えていますが、
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html
サンプルプログラムの実行のために
idf.py set-target esp32
とやると
CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
CMake 3.16 or higher is required. You are running version 3.14.5
とエラーが出て、バージョンが古いとのことで、
cmake --version
では、
cmake version 3.14.5
と出て確かに古いのですが
brew install cmake
とやると
Warning: cmake 3.26.4 is already installed and up-to-date.
と出て既に最新版が入っているようです。
which cmake
とやると
/opt/local/bin/cmake
でした。
3.14.5をアンインストールして3.26.4を使えるようにしたいのですが、どうしたらいいでしょうか?
発生している問題・エラー
$ idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory '/Users/***/esp/esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon/build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32, new sdkconfig will be created.
Running cmake in directory /Users/***/esp/esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/Users/***/.espressif/python_env/idf5.2_py3.11_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 /Users/***/esp/esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon"...
CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
CMake 3.16 or higher is required. You are running version 3.14.5
-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /Users/***/esp/esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon/build/log/idf_py_stderr_output_711 and /Users/***/esp/esp-idf/examples/bluetooth/bluedroid/ble/ble_ibeacon/build/log/idf_py_stdout_output_711
自分で試したこと
brew uninstall cmake
brew install cmake
とやって再インストールしても3.26.4がアンインストールされて再インストールされるだけで、3.14.5は消えませんでした。