[CMake] include dependecy problem

eial at cs.bgu.ac.il eial at cs.bgu.ac.il
Mon May 18 04:42:46 EDT 2009


hello.
I'm writing a c++ program under linux and I use cmake 2.6.4 to manage compilation.
in one of the files I need use external include files which resides in /usr/include/folder_name/, lets call them file1.h and file2.h
now if I declare the includes in my file like this:
#include <file1.h>
#include <file2.h>

compilation fails with an error: file1.h: No such file or directory and error: file2.h: No such file or directory.
but when I declare the includes like this:
#include <folder_name/file1.h>
#include <folder_name/file2.h>

compilation goes well. but, if this line exists in file2.h:
#include <file1.h>

compilation returns this: /usr/include/folder_name/file2.h error: file1.h: No such file or directory.
how can I fix this?

thanks




More information about the CMake mailing list