# - 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(ISE REQUIRED)


IF (DoQuMeasures_INCLUDE_DIRS AND DoQuMeasures_LIBRARIES)
   # in cache already
   SET(DoQuMeasures_FIND_QUIETLY TRUE)
ENDIF (DoQuMeasures_INCLUDE_DIRS AND DoQuMeasures_LIBRARIES)


#libfind_pkg_check_modules(ISE_PKGCONF ise-0.2)
IF (NOT WIN32)
  include(FindPkgConfig)
  pkg_check_modules(DoQuMeasures_PKGCONF DoQuMeasures-1.0)
  SET(DoQuMeasures_DEFINITIONS ${ISE_DEFINITIONS} ${DoQuMeasures_PKGCONF_CFLAGS_OTHER})
ENDIF (NOT WIN32)


# Include dir
find_path(DoQuMeasures_INCLUDE_DIR
  NAMES DoQuMeasures/MeasuresFacade.hpp
  PATHS ${DoQuMeasures_PKGCONF_INCLUDE_DIRS})

# Library
find_library(DoQuMeasures_LIBRARY
  NAMES DoQuMeasures-1.0
  PATHS ${DoQuMeasures_PKGCONF_LIBRARY_DIRS})


#set(ISE_PROCESS_INCLUDES ISE_INCLUDE_DIR)
#set(ISE_PROCESS_LIBS ISE_LIBRARY)
#libfind_process(ISE)


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(DoQuMeasures DEFAULT_MSG DoQuMeasures_LIBRARY DoQuMeasures_INCLUDE_DIR)

IF (ISE_FOUND)
  set(DoQuMeasures_INCLUDE_DIRS ${ISE_INCLUDE_DIRS} ${DoQuMeasures_INCLUDE_DIR})
  set(DoQuMeasures_LIBRARIES ${ISE_LIBRARIES} ${DoQuMeasures_LIBRARY})
#   MESSAGE("find ISE_INCLUDE_DIRS=${ISE_INCLUDE_DIRS}")
#   MESSAGE("find ISE_LIBRARIES=${ISE_LIBRARIES}")
#   MESSAGE("find ISE_INCLUDE_DIR=${ISE_INCLUDE_DIR}")
#   MESSAGE("find ISE_LIBRARY=${ISE_LIBRARY}")
#   MESSAGE("find ISE_LIBRARY=${ISE_LIBRARY}")

#   MESSAGE("find  ISE_PKGCONF_LDFLAGS=${ISE_PKGCONF_LDFLAGS}")
#   MESSAGE("find  ISE_PKGCONF_LDFLAGS_OTHER=${ISE_PKGCONF_LDFLAGS_OTHER}")
#   MESSAGE("find  ISE_PKGCONF_CFLAGS=${ISE_PKGCONF_CFLAGS}")
#   MESSAGE("find  ISE_PKGCONF_CFLAGS_OTHER=${ISE_PKGCONF_CFLAGS_OTHER}")
ENDIF (ISE_FOUND)


MARK_AS_ADVANCED(DoQuMeasures_INCLUDE_DIRS DoQuMeasures_LIBRARIES)

