问题
I am using Eclipse on a macOS machine. CMake is present on my machine at /usr/local/bin/cmake
and has been installed using Homebrew. Eclipse is at the latest version (2018-09).
I have the following target in a Makefile, which has been set up and is visible from Eclipse:
all:
./configure
Rscript -e "Rcpp::compileAttributes()"
R CMD INSTALL --no-multiarch --with-keep.source .
Inside the configure
file, there is this code:
cd src/build;cmake ..
However, when I double click the all
target in Eclipse, I get the following message:
make all
./configure
./configure: line 1: cmake: command not found
make: *** [all] Error 127
I remember that some time ago this target worked out of the box on macOS. I can also launch CMake from a terminal without any trouble.
echo $PATH
shows different behaviour:
- If called from a standard macOS terminal, it yields
/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
- If called from a TM Terminal inside Eclipse, it yields
/usr/bin:/bin:/usr/sbin:/sbin
What is the most canonical way to have Eclipse detect my CMake installation ?
回答1:
For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.
来源:https://stackoverflow.com/questions/52428657/command-line-tools-not-accessible-from-eclipse-on-osx