CLion header search path for 'installed' headers
We have a pretty large codebase (10K+ files).
And for some historical reasons all directories are organised the following way:
<prjroot>/
mylib1/
MyLib1Class1.h
MyLib1Class1.cpp
MyLib1Class2.h
MyLib1Class2.cpp
mylib2/
MyLib2Class1.h
MyLib2Class1.cpp
MyLib2Class2.h
MyLib2Class2.cpp
The 'install' target is doing the following:
rule 1:
install mylib1/*.h into install/LibMyLib1/ // note prefix Lib here
rule 2:
install mylib2/*.h into install/LibMyLib2Ext/ // note prefix Lib and suffix Ext here
All C++ files will include headers the following way:
//some_file.cpp:
#include <LibMyLib1/MyLib1Class1.h>
#include <ExtMyLib2/MyLib2Class1.h>
If I add "include_directories( install )" into CMakeLists.txt then CLion can successfully parse all files.
But when I ctrl+click onto MyLib1Class1 -> it opens "install/LibMyLib1/MyLib1Class1.h".
This is inconvenient, cause I cannot edit that file.
What I want CLion to do is to open: project source file "<prjroot>/mylib1/MyLib1Class1.h".
Of course CLion works fine if I change "include" directive to "#include <mylib1/MyLib1Class1.h>. But apparently I cannot change all 10K files, also it would break existing Makefile-based build system.
Any suggestions?
Maybe some sort of 'hacking' into CLions VFS sub-system?
Please sign in to leave a comment.
Found similar issue being discussed here: https://github.com/bazelbuild/intellij/issues/145