Closed 0x-matt closed 1 year ago
@jnavarrom can you help me please?
It seems you installed it using brew
and the /opt/homebrew/bin/cmake
is not in your PATH
.
You can manually add the install directory (e.g. /opt/homebrew/bin/cmake) to the PATH
Appreciate your reply. I did install cmake
using brew
. And I manually add the /opt/homebrew/bin/cmake
to the PATH, which is like this in my ~/.zshrc file:
PATH="/opt/homebrew/bin/cmake:$PATH"
PATH="/opt/homebrew/bin:$PATH"
PATH="/opt/homebrew/sbin:$PATH"
PATH="$PATH:$HOME/bin"
PATH="$PATH:/usr/local/go/bin"
PATH="~/.cargo/bin:$PATH"
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
PATH="$PATH:$HOME/.rvm/bin"
export PATH
Unfortunately, the same error still exists. Is that my .zshrc file config isn't correct? Or do I need to do something else, like add the path to .bashrc file?
If you open a terminal and run cmake
, is it found?
I didn't install it using brew
, I downloaded the precompiled binary from here: https://cmake.org/download/ and then followed install instructions from here: https://cmake.org/install/
which cmake
/usr/local/bin/cmake
PATH="/opt/homebrew/bin/cmake:$PATH"
I feel you missed here two double quotes (")
PATH="/opt/homebrew/bin/cmake":"$PATH"
Appreciate your patience and reply again! It really helped me a lot. At last, I resolved and compiled it successfully by using the following key way:
$ sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
Linked: '/usr/local/bin/cmake' -> '/Applications/CMake.app/Contents/bin/cmake'
Linked: '/usr/local/bin/ctest' -> '/Applications/CMake.app/Contents/bin/ctest'
Linked: '/usr/local/bin/cpack' -> '/Applications/CMake.app/Contents/bin/cpack'
Linked: '/usr/local/bin/cmake-gui' -> '/Applications/CMake.app/Contents/bin/cmake-gui'
Linked: '/usr/local/bin/ccmake' -> '/Applications/CMake.app/Contents/bin/ccmake'
which is inspired by your replied image. It is estimated that Xcode use /usr/local/bin/***
as its command path, so we must link these soft chains to installed third-party tools.
In addition, I guess
PATH="/opt/homebrew/bin/cmake:$PATH"
vs. PATH="/opt/homebrew/bin/cmake":"$PATH"
is the same thing, just written in two different ways.
General Information
MEGA Version: 8.2
iOS Version(s): 15.5
macOS Monterey 12.5
Xcode : 13.4.1
Devices/Simulators: Simulators
Reproducible? (Yes/No): Yes
What happened?
Xcode throw an error 'cmake: command not found' of PhaseScriptExecution when compiling.
But I've installed
cmake
command which can be confirmed bywhich cmake
in iTerm.What did you expect to happen?
Xcode can compile successfully.