title: How can I include Leptonica library in Tesseract Library cmakelists.cmake
body: <p>I'm building Tesseract OCR for OpenCV for Raspberry Pi using VisualGDB and Visual Studio 2017.
  I was able to build Leptonica library. </p>
  
  <p>It is located here:
  <code>D:\Projects\tesseract\leptonica</code></p>
  
  <p>The include files are located here <code>D:\Projects\tesseract\leptonica\src</code>
  And the built .so library files are located here <code>D:\Projects\tesseract\leptonica\build</code></p>
  
  <p>I'm trying to add Leptonica Cmake files to Tesseract CMakelists.cmake</p>
  
  <p>I'm reading the cmake tutorial found at <a href="https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-to-create-a-ProjectConfig.cmake-file" rel="nofollow noreferrer">https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-to-create-a-ProjectConfig.cmake-file</a>
  Unfortunately, its not a good tutorial but just an example, it doesn't explain the minimum lines I need to add another library. </p>
  
  <p>Using the example, I tried adding </p>
  
  <pre><code>add_subdirectory(leptonica)
  export(TARGETS leptonica FILE "${PROJECT_BINARY_DIR}/leptonica/build/LeptonicaConfig.cmake")
  include(${CMAKE_CURRENT_SOURCE_DIR}/leptonica/build/LeptonicaConfig.cmake)
  include_directories(${Leptonica_INCLUDE_DIRS})
  target_link_libraries(tesseract ${Leptonica_LIBRARIES})
  </code></pre>
  
  <p>I'm getting errors: 
  <code>A required package was not found</code>
  <code>configure_file problem configuring file</code></p>
  
  <p>What do I do to include the leptonica library in the tesseract CmakeLists so I can build Tesseract Ocr?</p>
  
  <p>Also, it was asking for <code>FindLeptonica.cmake</code> do I need to create this file? What do I put in it?</p>
  
  <p>Thanks</p>