title: Linking log4cpp library to project with cmake
body: <p>I am trying to link log4cpp to my project. I use CMake and i can't figure out a way to do so.</p>
  
  <p>Log4cpp is install on projectfolder/log4cpp/ (with bin/ include/ lib/ ... in it)</p>
  
  <p>I use the following Findlog4cpp.cmake : </p>
  
  <pre><code>IF (LOG4CPP_FOUND)
      SET(LOG4CPP_FIND_QUIETLY TRUE)
  ENDIF (LOG4CPP_FOUND)
  
  FIND_PATH(LOG4CPP_INCLUDE_DIR log4cpp/FileAppender.hh
      "./log4cpp/include/"
  )
  
  FIND_LIBRARY(LOG4CPP_LIBRARIES
    NAMES liblog4cpp.so
    PATHS "./log4cpp/lib"
  )
  
  SET(LOG4CPP_FOUND 0)
  IF(LOG4CPP_INCLUDE_DIR)
    IF(LOG4CPP_LIBRARIES)
      SET(LOG4CPP_FOUND 1 CACHE INTERNAL "log4cpp found")
      IF (NOT LOG4CPP_FIND_QUIETLY)
        MESSAGE(STATUS "Found Log4CPP")
      ENDIF (NOT LOG4CPP_FIND_QUIETLY)
    ENDIF(LOG4CPP_LIBRARIES)
  ENDIF(LOG4CPP_INCLUDE_DIR)
  
  MARK_AS_ADVANCED(
    LOG4CPP_INCLUDE_DIR
    LOG4CPP_LIBRARIES
  ) 
  </code></pre>
  
  <p>and in my CMakeLists.txt i call it : </p>
  
  <pre><code>...
  FIND_PACKAGE(log4cpp REQUIRED)
  INCLUDE_DIRECTORIES(${LOG4CPP_INCLUDE_DIR})
  SET(LIBS ${LOG4CPP_LIBRARIES} ${LIBS})
  
  MESSAGE("############################# ${LOG4CPP_LIBRARIES}")
  MESSAGE("############################# ${LOG4CPP_INCLUDE_DIR}")
  ...
  </code></pre>
  
  <p>The output : </p>
  
  <pre><code>-- Found Log4CPP
  ############################# /SOMEPATH/projectfolder/log4cpp/lib/liblog4cpp.so
  ############################# /SOMEPATH/projectfolder/log4cpp/include
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /SOMEPATH/projectfolder/
  </code></pre>
  
  <p>Then when i run make i have the folowing errors :</p>
  
  <pre><code>/SOMEPATH/projectfolder/common/Common.h:24:31: error: log4cpp/Category.hh: No such file or directory
  /SOMEPATH/projectfolder/common/Common.h:25:35: error: log4cpp/FileAppender.hh: No such file or directory
  /SOMEPATH/projectfolder/common/Common.h:26:34: error: log4cpp/BasicLayout.hh: No such file or directory
  </code></pre>
  
  <p>i just included the headers in common.h ( #include "log4cpp/xxx.hh" )</p>
  
  <p>I add that all the build and compile works fine (with cmake then make) without log4cpp</p>
  
  <p>Any help would be greatly appreciated</p>