I'm using company-mode for completion in C++ code. To tell clang backend of company where the include files for the current project are I have to use the following .dir-locals.el
file
((c++-mode (eval setq company-clang-arguments (append
company-clang-arguments
'("-I/full/path/to/project/root/include"))))
I have to specify the full path always. Is there a way to replace full/path/to/project/root
with a variable that stores the path the the .dir-locals.el
file?
I tried
(c++-mode (eval setq company-clang-arguments (append
company-clang-arguments
(list concat "-I" default-directory "src")))))
but since default-directory
is evaluated in the file that I'm opening it doesn't return to path the the project root but some other path inside the project.