How to use ninja to compile much faster.

1. Download the latest version of cmake (v 2.8.8). Currently Ninja is turned on by default for linux but not for Apple.

Turn on Ninja (For Apple machine)
Edit cmake-2.8.8/Source/CMakeLists.txt:

Find the following lines :
if(WIN32 OR APPLE)
  SET(_CMAKE_DEFAULT_NINJA_VALUE FALSE)
endif()

and change it to :
if(WIN32)
  SET(_CMAKE_DEFAULT_NINJA_VALUE FALSE)
endif()

[you may not need to do this in the future if the cmake developers turn ninja on by default for apple.]

  Then compile and install cmake. Run 
 
./bootstrap
make
sudo make install

2. Download ninja via github:

 git clone https://github.com/martine/ninja.git

 and run 

   python bootstrap.py


3. Then, in cmake, replace make with ninja as follows:

./make_project.py all
cd build_release
cmake -G Ninja
ninja

  Or use:

ninja -v

  to see all the g++ or clang commands.
