# - Try to find ISE 
# Once done, it will define
#
# ISE_FOUND - system has ISE
# ISE_INCLUDE_DIRS - ISE include directories
# ISE_DEFINITIONS - Compiler switches required for using ISE
# ISE_LIBRARIES - link these to use ISE

#include(LibFindMacros)


find_package(Qt4 REQUIRED)
INCLUDE( ${QT_USE_FILE} )
FIND_PACKAGE(OCRopus REQUIRED)


IF (OCRUtils_INCLUDE_DIRS AND OCRUtils_LIBRARIES)
   # in cache already
   SET(OCRUtils_FIND_QUIETLY TRUE)
ENDIF (OCRUtils_INCLUDE_DIRS AND OCRUtils_LIBRARIES)


IF (NOT WIN32)
  include(FindPkgConfig)
  pkg_check_modules(OCRUtils_PKGCONF OCRUtils-1.0)
  SET(OCRUtils_DEFINITIONS ${OCRUtils_PKGCONF_CFLAGS_OTHER})
ENDIF (NOT WIN32)


# Include dir
find_path(OCRUtils_INCLUDE_DIR
  NAMES OCRUtils/OcroIze.hpp
  PATHS ${OCRUtils_PKGCONF_INCLUDE_DIRS})


# Library
find_library(OCRUtils_LIBRARY
  NAMES OCRUtils-1.0
  PATHS ${OCRUtils_PKGCONF_LIBRARY_DIRS})


INCLUDE(FindPackageHandleStandardArgs)

# handle the QUIETLY and REQUIRED arguments and set ISE_FOUND to TRUE if 
# all listed variables are TRUE
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OCRUtils DEFAULT_MSG OCRUtils_LIBRARY OCRUtils_INCLUDE_DIR)

 set(OCRUtils_INCLUDE_DIRS ${OCRUtils_INCLUDE_DIR} ${OCRopus_INCLUDE_DIRS})
 set(OCRUtils_LIBRARIES ${OCRUtils_LIBRARIES} ${OCRUtils_LIBRARY} ${QT_LIBRARIES} ${OCRopus_LIBRARIES})



MARK_AS_ADVANCED(OCRUtils_INCLUDE_DIRS OCRUtils_LIBRARIES)

