Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get CMake's Ninja test command

Tags:

cmake

ninja

I'm trying to make Ninja work with CMake on FreeBSD 10.3:

cmake -GNinja ..
-- Configuring done
CMake Error:
  The detected version of Ninja () is less than the version of Ninja required
  by CMake (1.3).

-- Build files have been written to: /home/me/pj/_build

I have put a locally compiled (from Git tag v1.8.2) Ninja in ~/bin/ninja (which is in my $PATH).

$ cmake -version
cmake version 3.4.1
$ ninja --version
1.8.2

I also tried to add -DCMAKE_MAKE_PROGRAM=ninja and -DCMAKE_MAKE_PROGRAM=~/bin/ninja without effect.

I also tried to see if Ninja was really called (by putting a script writing a new file), and it looks like it's never called.

Is there a way to see which commands are used to to check the Ninja version?

like image 378
GlinesMome Avatar asked Oct 20 '25 12:10

GlinesMome


1 Answers

By inspecting the generated CMakeCache.txt file, you should be able to tell which Ninja version is picked by CMake.

In CMakeCache.txt you should have something similar to:

// Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/ninja

which could tell which Ninja version is picked by default and whether -DCMAKE_MAKE_PROGRAM is respected or from some reason ignored.

Also, it is worth looking into the generated CMakeOutput.log and CMakeError.log files.

I would also suggest adding ninja to your PATH, hoping CMake would pick it from there.

like image 56
valiano Avatar answered Oct 23 '25 06:10

valiano



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!