[CMake] CMAKE_EXPORT_COMPILE_COMMANDS, compile_commands.json content
Martin Weber
fifteenknots505 at gmail.com
Fri May 18 15:43:45 EDT 2018
Hi all,
in the generated compile_commands.json, what are the quoting rules in the
command fields?
Apart from the fact that a quotation mark in json inside a value has to be
escaped as *\"*, do the arguments in the command-field follow the shell-
escape rules or do they reflect the arguments passed to exec(1).
Seeing a line in my compile_commands.json starting with
"command": "/usr/bin/c++ -Dprojectname_ROOT_DIR=\\\"/home/username/workspace/
projectname\\\"
is confusing. What exactly is the value of macro projectname_ROOT_DIR here? A
string literal?
OTOH, the same line has
-DvtkFiltersFlowPaths_AUTOINIT=\"1(vtkFiltersParallelFlowPaths)\"
which I do recognize as a macro value of string literal type.
Background: My tool tries to get the macro definition from the
compile_commands.json file [1]
TIA,
Martin
[1] https://github.com/15knots/cmake4eclipse/issues/74
--
Cd wrttn wtht vwls s mch trsr.
More information about the CMake
mailing list