Proper way to link to Caffe library in C++ project

36 views
Skip to first unread message

Nyan Naing

unread,
Feb 9, 2017, 2:33:35 AM2/9/17
to Caffe Users

I am using caffe library for my project.

My CMakeLists.txt file is as follow


cmake_minimum_required(VERSION 2.6)
PROJECT
(endtoendlib)
set(Caffe_DIR "/home/Softwares/Libraries/caffe-master/build/cmake")
include_directories
( ${PROJECT_BINARY_DIR})
# Find Caffe
FIND_PACKAGE
(Caffe REQUIRED)
# adding sources to target
add_executable
(endtoendlib endtoendLstm.cpp)
target_link_libraries
(endtoendlib ${Caffe_LIBS})

When I run cmake .. , I have error as

CMake Warning (dev) at /home/Softwares/Libraries/caffe-master/build/cmake/CaffeConfig.cmake:22 (if): given arguments: "ON" An argument named "ON" appears in a conditional statement. Policy CMP0012 is not set: if() recognizes numbers and boolean constants. Run "cmake --help-policy CMP0012" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): CMakeLists.txt:9 (FIND_PACKAGE) This warning is for project developers. Use -Wno-dev to suppress it.

How can I solve the problem?

Is there a better way to link to caffe library and its accessories?

Reply all
Reply to author
Forward
0 new messages