https://github.com/Kitware/CMake
Raw File
Tip revision: 166bf4c490b8f46eca057fc23c3f3c2e042e9cb3 authored by Brad King on 13 December 2017, 13:34:28 UTC
CMake 3.10.1
Tip revision: 166bf4c
CMAKE_EXPORT_COMPILE_COMMANDS.rst
CMAKE_EXPORT_COMPILE_COMMANDS
-----------------------------

Enable/Disable output of compile commands during generation.

If enabled, generates a ``compile_commands.json`` file containing the exact
compiler calls for all translation units of the project in machine-readable
form.  The format of the JSON file looks like:

.. code-block:: javascript

  [
    {
      "directory": "/home/user/development/project",
      "command": "/usr/bin/c++ ... -c ../foo/foo.cc",
      "file": "../foo/foo.cc"
    },

    ...

    {
      "directory": "/home/user/development/project",
      "command": "/usr/bin/c++ ... -c ../foo/bar.cc",
      "file": "../foo/bar.cc"
    }
  ]

.. note::
  This option is implemented only by :ref:`Makefile Generators`
  and the :generator:`Ninja`.  It is ignored on other generators.
back to top