[CMake] custom_command and compile_commands.json

Nagy-Egri Máté Ferenc csiga.biga at aol.com
Sun Nov 5 13:07:27 EST 2017


Hi!

I am trying to export a custom_command to the compile_commands.json database, but no luck up until now. The only similar question I found on the web is a Stackoverflow thread named „cmake clang-tidy (or other script) as custom target”.

I am trying to bring together C/C++ compilation, GnuPlot and LaTeX into a single Cmake script (done), and have the relevant Visual Studio Code extensions hook into the compile_commands.json file to recognize CMakes machinery and that they themselves are not responsible for kicking off the compilation of their respective source files. Microsofts C++ extension is compile_commands.json aware, but the LaTeX-Workshop extensino is not. I wanted to do the research before jumping to feature requests: is it possible to export @kmorel Github users UseLATEX custom_commands into the compile_commands.json database? As far as I saw, setting CMAKE_EXPORT_COMPILE_COMMANDS to ON right before add_latex_document() is not enough. Does LATEX need to be a first-class CMake language in order for this machinery to kick off?


Tanks in advance,
Máté
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171105/3afb5872/attachment.html>


More information about the CMake mailing list