I have a project layout as follows:
I cannot change the directory layout due to the build system that we're using. Headers are included as
#include "project_a/some_header.h
also from the corresponding .cxx file.
I've created a CMakeLists.txt file in the root directory, that adds all my projects via include_directories(project_a project_b), which should be the path prefixed before the one given in the #include. CLion does not manage to find and index any of my files.
Additionally, I have an automatically generated directory of headers of structure
and I've set them up accordingly, but it also does not work.
Does CLion not manage to resolve the prefixed path in the #include or why is this not working?
In CMakeList.txt, which should be located in parent folder, "workspace" folder in that situation, add
set(INCLUDE_DIRECTORIES ./)
If, for example, there is a parent folder, that holds include files:
Then CMakeList.txt should contain
set(INCLUDE_DIRECTORIES ./)
include_directories(includes_folder)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With