. Advertisement .
..3..
. Advertisement .
..4..
Today I still get the ”this file does not belong to any project target”error.
I have a header-only library project set up using the cmake command:
add_library(my_library INTERFACE)
And I add:
target_sources(my_library INTERFACE ${MY_LIRBARY_HEADER_FILES})
I receive the following message when I open a source file:
This file does not belong to any project target, code insight features might not work properly
I don’t know what’s wrong?
Can someone help me?
The cause: The warning is displayed as a result of the inability of CLion to properly index header files.
Solution: The best way for this issue is :
Mark directory as
|Library Files
/Project Sources and Headers
.