title: CMake + Ninja : how to implement incremental compilation under the path of different source directories
body: <p>Every time I get a different source directory, and I have a fixed build directory. Every time I will run <code>cmake /path/to/project</code> and run ninja. It will report an error : <code>Make Error: The source &quot;/path1/to/project/CMakeLists.txt&quot; does not match the source &quot;/path2/to/project/CMakeLists.txt&quot; used to generate cache. Re-run cmake with a different source directory.</code></p>
  <p>So what I did was manually change the options related to the path of project in the CMakeCache.txt. The result is that it will compile the project from scratch every time instead of incrementally compiling, So is there any feasible way to achieve incremental compilation or in this case it is impossible to achieve incremental compilation ？</p>