The default generator and all other associated information ( '-D' ) is
kept in the CMakeCache.txt file in the root of the build directory.
The execution of `cmake -S <source_dir> -B <binary_dir>` will reload
this cache before doing anything else. Have you verified that your
build directory hasn't deleted this file?

On Tue, Oct 8, 2019 at 8:31 PM Nagurne, James via CMake <cmake@cmake.org> wrote:
>
> Hi all,
>
>
>
> My question comes from a Ninja generator build system, and is specifically 
> about an internal rule generated by cmake.
>
> What is the purpose of the RERUN_CMAKE rule generated by CMake with a Ninja 
> generator?
>
>
>
> In the current repo, the only reference to this rule is in 
> WriteTargetRebuildManifest here
>
> At line 1285, the rule is written out, seemingly as-is.
>
>
>
> According to lines 1274 to 1284, the only actual behavior of this command, 
> which is executed whenever the source CMakeLists.txt file, files included 
> from the CMakeLists, and some other CMake installation files change, is:
>
> cmake -S <source_dir> -B <binary_dir>
>
>
>
> This seems completely insufficient for “re-running” cmake. The most obvious 
> flaw is the absence of the generator. When I’ve seen this rule fire, my Ninja 
> build system adds a useless Makefile to the build system, and then 
> (hopefully) continues building as if nothing had been done at all, without so 
> much as inspecting that Makefile.
>
>
>
> What about command-line arguments like -D?
>
>
>
> Am I missing the purpose of this rule or potentially doing something 
> non-standard? The reason I send an email is because this behavior is sending 
> my project into a cmake loop where it detects build.ninja is out of date, 
> re-runs cmake to generate a Makefile instead of a ninja build system, and 
> then infinitely repeats because it never actually re-ran anything.
>
>
>
> Thanks,
>
> JB
>
> Code Generation
>
> Texas Instruments
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to