Currently, I can use CMakeLists.txt to build a project. Let’s say, in CMake to build the project, the path of source code is PATH, and the path of binaries is PATH/bin.
Then, I want to add some myself code, for example, some classes.
I put the myclass.h and myclass.cpp in PATH. Then, in the main code, I include myclass.h by " #include <myclass.h> ", and bug is reported as:
cannot open source file “myclass.h”
Should I change the CMakeLists.txt to include the myclass.h and myclass.cpp?
I don’t understand by ‘#include-ing myclass.h from GPURegistration.cxx’. The myclass is not defined in the GPURegistration.cxx, but in a seperate file myclass.h. I put the myclass.h and GPURegistration.cxx in the same folder. The folder contains:
#include <myclass.h> only looks for includes in “system” directories. To also look in current directory, you need #include "myclass.h" (quotes, not angle brackets).