I'm using CLion 2018.2
to write C/C++
code for a custom compiler toolchain which are not supported natively by CLion
. I currently compile with make
on the Terminal
instead of building from within the IDE.
I have a custom include directory with header files which are not resolved/found by CLion
since they are not part of the project. However, I want to get code inspection features for them. The headers are e.g. located at C:\devkitPro\wups\include
.
I decided to use the include_directories()
CMake
command to improve CLion
's ability to resolved code:
include_directories("C:\\devkitPro\\wups\\include")
Then I also modified the CMake
include path:
set(CMAKE_INCLUDE_PATH "C:\\devkitPro\\wups\\include")
And also decided to link against the lib
directory:
link_directories("C:\\devkitPro\\wups\\lib")
After doing all that, the headers still aren't resolved in CLion
(but it still compiles using make
of course). How can the header resolution be done with CLion
or is it not possible, yet?
Depending on the configured toolchain in
CLion
,CMake
expects aWindows
or aWSL
-style path. Inspections will work with theinclude_directories
directive, e.g.A more detailed written tutorial can be found in this pull request.