KDevelop C++ says i have a missing include file

187 Views Asked by At

I have small (almost hello world) project made with CLion and CMake. I tried to open it in KDevelop, and it opens, compiles and builds without any problem, the .exe file works aswell.

But why does KDevelop say i need to

enter image description here

The DataLoader.h is in /include folder, and i know i can set it manually in KDevelop settings, but shouldn't every IDE search automatically in /include folder when its specified in CMakeLists?

enter image description here

What I'm trying to exactly do, is make a simple project that I can load in any C++ IDE without having to manually set anything for this project espacially (not talking about paths to mingw cmake etc, but rather current project related problems like this one)

Can i somehow specify in the CMake project to tell the IDE's, that they should automatically look into the /include folder?

1

There are 1 best solutions below

5
Angelo Mantellini On

try to change include_directories with

include_direcotries(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)