[cmake-developers] Extending CMAKE_EXPORT_COMPILE_COMMANDS

Stephen Kelly steveire at gmail.com
Mon Jun 18 06:50:18 EDT 2012


Bertjan Broeksema wrote:

> Hi List,
> 
> I recently found out about the CMAKE_EXPORT_COMPILE_COMMANDS option while
> getting myself familiar with clang. In a tool [1] I'm working on (or
> rather, start to work again) I need something similar.

Hi Bertjan,

Here's something interesting for you :)

http://www.kdab.com/automated-porting-from-qt-4-to-qt-5/

> 
> The current CMAKE_EXPORT_COMPILE_COMMANDS option only exports compile
> commands (as its name suggest). However, in my tool I build and visualize
> the full graph (i.e. source, headers, objectfiles, libaries). For this I
> also would need the link commands. Currently I've a wrapper around the C++
> compiler, which works fine, but after having seen this option I realized
> that this would be way more convenient. Is it possible to get a similar
> option for exporting link commands or perhaps both:
> 
> CMAKE_EXPORT_LINK_COMMANDS
> CMAKE_EXPORT_COMPILE_AND_LINK_COMMANDS
> 
> I'm willing to work on a patch, given that a) the option has a change to
> get included, b) I get some pointers on where to start to make it happen.

Brad brought up the same thing on the original thread on this topic:

http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/693/focus=711

Recently there hass also been discussion on the clang mailing list about 
this:

http://thread.gmane.org/gmane.comp.compilers.clang.devel/21723/focus=21802

As clang would have to use such a 'link command' database, it might make 
sense to start a conversation there about this too. 

Could it make sense to export a 'build database' instead of separate ones 
for compile and link (and other things, like files that need to be generated 
etc?)


Thanks,

Steve.





More information about the cmake-developers mailing list