libraries to read compiler flags from a CMake build tree -


youcompleteme awesome vim plugin c++, however, requires user provided .ycm_extra_conf.py script return compiler flags each c/c++ source.

currently have cmake based c++ project, , want use plugin ease development, need write .ycm_extra_conf.py script programmatically figure out compiler flag each source file.

so question is, there way programatically find out compiler flags each source looking build directory, given have ran cmake , generated bunch of files.

there won't generic solution cmake can generate build solution different platforms , programs, e.g. makefiles vs. visual studio projects.

for makefile generator try find relevant information in cmakefiles/cmakedirectoryinformation.cmake files or directly makefiles. not reliable solution because these files internals of makefile generator , might change every cmake version.

the solution eclipse uses parse output of compiler invocations include flags etc. bit more reliable. makefiles can enable full output compiling verbose=1 given environment or call variable make.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -