1

I have MacOS Catalina, Cmake, Ninja and QtCreator installed with the following versions and paths:

[@bin]$ sw_vers -productVersion
10.15.6
[@bin]$ which cmake
/usr/local/bin/cmake
[@bin]$ cmake --version
cmake version 3.18.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[@bin]$ which ninja
/usr/local/bin/ninja

I'm trying to build a project with QT creator using Cmake. However, the following message appears in QT Creator

Running /usr/local/Cellar/cmake/3.18.2/bin/cmake '-GCodeBlocks - Ninja' -C /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/qtcsettings.cmake /Users/mymac/Documents/programming/Cpp/Qt/try6 in /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan.
loading initial cache file /private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/qtcsettings.cmake
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/jq/yyp9q2fs1z5780k9l1_2ph4r0000gn/T/QtCreator-HXderc/qtc-cmake-TuClFWan/CMakeFiles/CMakeOutput.log".
CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake process exited with exit code 1.
Elapsed time: 00:00.

As indicated on several websites (such as this SO question I tried the following command but it didn't work:

[@bin]$ ln -s /usr/bin/ninja /usr/bin/ninja-build
ln: /usr/bin/ninja-build: Operation not permitted

As indicated in the comments I tried also the following:

[@bin]$ sudo ln -s /usr/bin/ninja /usr/bin/ninja-build
Password:
ln: /usr/bin/ninja-build: Operation not permitted

I also tried:

[@bin]$ sudo ln -s /usr/bin/ninja /usr/local/bin/ninja-build

It didn't cause any error message but the problem in QT creator persisted

ecjb
  • 5,169
  • 12
  • 43
  • 79
  • Did you try the command to create `/usr/bin/ninja-build` using `sudo`? – Anthony Smith Sep 19 '20 at 16:29
  • @AnthonySmith: many thanks for your comment, I just tried `sudo /usr/bin/ninja-build` (and edited the question accordingly) but it didn't work. Is this what you meant? – ecjb Sep 19 '20 at 16:34
  • No, it should be `sudo ln -s /usr/bin/ninja /usr/bin/ninja-build`. – Anthony Smith Sep 19 '20 at 16:42
  • @AnthonySmith: Ok, I also tried `sudo ln -s /usr/bin/ninja /usr/bin/ninja-build` but got an `Operation not permitted` – ecjb Sep 19 '20 at 16:46
  • 1
    What about trying to put the symbolic link in `/usr/local/bin` instead of the distrubution bin folder, that should still be in the path as well? `sudo ln -s /usr/bin/ninja /usr/local/bin/ninja-build` – Anthony Smith Sep 19 '20 at 16:52
  • @AnthonySmith. So I typed `sudo ln -s /usr/bin/ninja /usr/local/bin/ninja-build`. This I didn't get an error message, but the message in QT creator (after I restarted the computer) persisted – ecjb Sep 19 '20 at 17:00
  • 1
    Are you launching QtCreator from the terminal, or from clicking on an icon? It seems (from this answer: https://stackoverflow.com/a/52220350/11357540) that they have different paths provided to them based on how they are launched – Anthony Smith Sep 19 '20 at 17:08
  • 1
    Also, it looks like the path for the `ln` command was wrong, looking at your `which ninja` return. Try `sudo ln -s /usr/local/bin/ninja /usr/local/bin/ninja-build`, if that fails, try removing ninja-build `sudo rm /usr/local/bin/ninja-build` and then try the command again. – Anthony Smith Sep 19 '20 at 17:20
  • @AnthonySmith: I launched Xcode (which I installted previously but didn't launch and it seems that there was some last setup at first launch that needed to be done) and create an alias for Qt Creator and launched it from terminal and it finally worked. So I don't know what was exatly the problem at the end... many thanks for your support! – ecjb Sep 19 '20 at 18:28

0 Answers0