[CMake] Make CMAKE_EXPORT_COMPILE_COMMANDS not default?

Alexander Neundorf a.neundorf-work at gmx.net
Sun Dec 8 09:36:52 EST 2013


On Monday 02 December 2013, Martin Zenzes wrote:
> Hi,
> 
> is there a reason why the cmake-option "CMAKE_EXPORT_COMPILE_COMMANDS"
> is not enabled by default? It was exposed as an option in 2011 [1], a
> few days after adding it initially. It can be enabled manually by adding
> "set(CMAKE_EXPORT_COMPILE_COMMANDS ON)" into the CMakeLists.txt or
> giving the option on the commandline as in "mkdir -p build && cd build
> && cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=on"
> 
> The option generates a file "compile_commands.json", containing the
> exact calls for all translation units of the project in machine-readable
> form. Benefits:

what is actually the purpose of this feature ?
It sounds to me a bit more like it should be an additional "extra" generator, 
i.e. generate makefiles/ninja files and additionally this json file.

Alex


More information about the CMake mailing list