BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.09k stars 18.71k forks source link

cmake without Caffe_INCLUDE_DIRS #5532

Open lisongze opened 7 years ago

lisongze commented 7 years ago

Hi, I have a project which used caffe, in my project CMakeList.txt, I used find_package(caffe) to look for caffe and it successed, I used to use Caffe_INCLUDE_DIRS to tell my project the include path of caffe.

But I noticed that caffe had removed the definition of Caffe_INCLUDE_DIRS recently, and used IMPORTED target interface instead. I used get_property(Caffe_INCLUDE_DIRS TARGET caffe PROPERTY INTERFACE_INCLUDE_DIRECTORIES) to fetch caffe include path, but it seems that part of the path are missing, such as "/my_caffe_path/caffe/build/include" and "/my_caffe_path/caffe/src". These two path was existed in Caffe_INCLUDE_DIRS, but now it is missing, so my program can't locate "caffe/proto/caffe_pb.h".

Is there anyone know this problem?

umariqb commented 7 years ago

Hi, Did you find a solution to this problem?

gautamMalu commented 7 years ago

check this out https://github.com/davheld/GOTURN/issues/4 the basic idea is to make a FindCaffe.cmake and put it into your cmake/modules folder. In this file we can define Caffe_INCLUDE_DIRS and Caffe_LIBS with respect to Caffe_ROOT (caffe/distribute) . Check out that link it has an example of FindCaffe.cmake

Tones29 commented 6 years ago

What worked for me was creating a symlink to the missing headers:

cd <...>/caffe/include/caffe
ln -s ../../build/include/caffe/proto .

Rather a workaround, than a profound solution...