1

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 ?

vkubicki
  • 1,104
  • 1
  • 11
  • 26
  • You may try to output content of `PATH` variable in Eclipse (e.g. with `echo $PATH`) and check whether it contains `/usr/local/bin/`. – Tsyvarev Sep 20 '18 at 15:50
  • I installed TM Terminal and you are correct, paths are different. I did not expect that... I edited my answer above. – vkubicki Sep 21 '18 at 08:23
  • I saw various solutions, which change from version to version of macOS, for the time being I will launch Eclipse from a terminal using /Applications/Eclipse.app/Contents/MacOS/eclipse . I would happily change from a cleaner solution, for example editing a setting in Eclipse. – vkubicki Sep 21 '18 at 09:31

1 Answers1

0

For macOS High Sierra 10.13.6, the solution provided here works. This must be performed to see the changes immediately.

vkubicki
  • 1,104
  • 1
  • 11
  • 26