Hi, I've just encountered a problem about clion not indexing my headers and macron definitions.
The situation is that, although the building process of the whole project can finish without error, Clion can't index some of my headers.
The Makefile project is a little bit complex, where the outermost Makefile recursively calls Makefiles in subdirectories, each subdirectory typically corresponds to a unique app, and the Makefile in each subdirectories again "include" other Makefiles in other places, which made the project rather complex (at least for clion to index, I think). The structure is illustrated as follows:
Within the Makefile of subappDir3, it only has 3 lines:
Due to some histotic factors, all the include statements for user defined files like #include"myheader.h" are all written without any prefix paths( not like #include"dir1/dir2/myHeader.h"). For compiling, we have -I flag, but clion doesn't seem to be able to recognize this.
To make clion index these headers, all I can think of for now is to write an addtional CMakelist.txt file and inside which, add the include dirs for each target and call the target in the outermost Makefile to do finish the rest. If this will work theoretically, please let me know and I will try that! thanks!!! In the worst case, I can replace all Makefiles by new CMakelist.txt, but I'm not familiar with CMake, so this would probably take all my weekends...
Is there any way to give clion a hint about where to find my header files just like giving -I to gcc? Or is there any other other way to fix this?