title: Proper way to link to Caffe library
body: <p>I am using <a href="http://caffe.berkeleyvision.org/" rel="nofollow noreferrer">caffe library</a> for my project.</p>
  
  <p>My <code>CMakeLists.txt</code> file is as follow</p>
  
  <pre><code>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})
  </code></pre>
  
  <p>When I run <code>cmake ..</code> , I have error as</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>How can I solve the problem?</p>
  
  <p>Is there a better way to link to caffe library and its accessories?</p>